Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
a38ab5b
1
Parent(s):
218550a
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,6 @@ def update_selection(selected_state: gr.SelectData):
|
|
58 |
'''
|
59 |
if is_compatible:
|
60 |
use_with_diffusers += f'''
|
61 |
-
```python
|
62 |
from diffusers import StableDiffusionXLPipeline
|
63 |
import torch
|
64 |
|
@@ -68,10 +67,9 @@ def update_selection(selected_state: gr.SelectData):
|
|
68 |
pipe.load_lora_weights("{lora_repo}", weight_name="{weight_name}")
|
69 |
|
70 |
prompt = "{instance_prompt}..."
|
71 |
-
|
72 |
-
image = pipe(prompt, num_inference_steps=30, guidance_scale=7.5, cross_attention_kwargs={{"scale":
|
73 |
image.save("image.png")
|
74 |
-
```
|
75 |
'''
|
76 |
else:
|
77 |
use_with_diffusers += "This LoRA is not compatible with diffusers natively yet. But you can still use it on diffusers with `bmaltais/kohya_ss` LoRA class, check out this [Google Colab](https://colab.research.google.com/drive/14aEJsKdEQ9_kyfsiV6JDok799kxPul0j )"
|
|
|
58 |
'''
|
59 |
if is_compatible:
|
60 |
use_with_diffusers += f'''
|
|
|
61 |
from diffusers import StableDiffusionXLPipeline
|
62 |
import torch
|
63 |
|
|
|
67 |
pipe.load_lora_weights("{lora_repo}", weight_name="{weight_name}")
|
68 |
|
69 |
prompt = "{instance_prompt}..."
|
70 |
+
lora_scale= 0.9
|
71 |
+
image = pipe(prompt, num_inference_steps=30, guidance_scale=7.5, cross_attention_kwargs={{"scale": lora_scale}}).images[0]
|
72 |
image.save("image.png")
|
|
|
73 |
'''
|
74 |
else:
|
75 |
use_with_diffusers += "This LoRA is not compatible with diffusers natively yet. But you can still use it on diffusers with `bmaltais/kohya_ss` LoRA class, check out this [Google Colab](https://colab.research.google.com/drive/14aEJsKdEQ9_kyfsiV6JDok799kxPul0j )"
|