Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
efaf9fb
1
Parent(s):
c4cd17d
Update app.py
Browse files
app.py
CHANGED
@@ -50,26 +50,25 @@ def update_selection(selected_state: gr.SelectData):
|
|
50 |
weight_name = sdxl_loras[selected_state.index]["weights"]
|
51 |
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
|
52 |
use_with_diffusers = f'''
|
53 |
-
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
use_with_uis = f'''
|
74 |
## Use it with Comfy UI, Invoke AI, SD.Next, AUTO1111:
|
75 |
|
|
|
50 |
weight_name = sdxl_loras[selected_state.index]["weights"]
|
51 |
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
|
52 |
use_with_diffusers = f'''
|
53 |
+
## Using [`{lora_repo}`](https://huggingface.co/{lora_repo})
|
54 |
|
55 |
+
## Use it with diffusers:
|
56 |
|
57 |
+
```python
|
58 |
+
from diffusers import StableDiffusionXLPipeline
|
59 |
+
import torch
|
60 |
|
61 |
+
model_path = "stabilityai/stable-diffusion-xl-base-1.0"
|
62 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16)
|
63 |
+
pipe.to("cuda")
|
64 |
+
pipe.load_lora_weights("{lora_repo}", weight_name={weight_name})
|
|
|
65 |
|
66 |
+
prompt = "{instance_prompt}..."
|
67 |
+
lora_weight = 0.5
|
68 |
+
image = pipe(prompt, num_inference_steps=30, guidance_scale=7.5, cross_attention_kwargs={{"scale":lora_weight}}).images[0]
|
69 |
+
image.save("image.png")
|
70 |
+
```
|
71 |
+
'''
|
72 |
use_with_uis = f'''
|
73 |
## Use it with Comfy UI, Invoke AI, SD.Next, AUTO1111:
|
74 |
|