Spaces:
Runtime error
Runtime error
Commit
·
7efd9a0
1
Parent(s):
a56c826
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,13 +41,11 @@ css = '''
|
|
| 41 |
border-top-left-radius: 0px;}
|
| 42 |
'''
|
| 43 |
|
| 44 |
-
|
| 45 |
-
original_pipe = copy.deepcopy(pipe)
|
| 46 |
|
| 47 |
#@spaces.GPU
|
| 48 |
def merge_and_run(prompt, negative_prompt, shuffled_items, lora_1_scale=0.5, lora_2_scale=0.5, progress=gr.Progress(track_tqdm=True)):
|
| 49 |
-
|
| 50 |
-
pipe = copy.deepcopy(original_pipe)
|
| 51 |
print("Loading LoRAs")
|
| 52 |
pipe.load_lora_weights(shuffled_items[0]['repo'], weight_name=shuffled_items[0]['weights'])
|
| 53 |
pipe.fuse_lora(lora_1_scale)
|
|
@@ -64,7 +62,7 @@ def merge_and_run(prompt, negative_prompt, shuffled_items, lora_1_scale=0.5, lor
|
|
| 64 |
|
| 65 |
def get_description(item):
|
| 66 |
trigger_word = item["trigger_word"]
|
| 67 |
-
return f"LoRA trigger word: `{trigger_word}`" if trigger_word else "
|
| 68 |
|
| 69 |
def shuffle_images():
|
| 70 |
compatible_items = [item for item in sdxl_loras if item['is_compatible']]
|
|
|
|
| 41 |
border-top-left-radius: 0px;}
|
| 42 |
'''
|
| 43 |
|
| 44 |
+
|
|
|
|
| 45 |
|
| 46 |
#@spaces.GPU
|
| 47 |
def merge_and_run(prompt, negative_prompt, shuffled_items, lora_1_scale=0.5, lora_2_scale=0.5, progress=gr.Progress(track_tqdm=True)):
|
| 48 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
|
|
|
|
| 49 |
print("Loading LoRAs")
|
| 50 |
pipe.load_lora_weights(shuffled_items[0]['repo'], weight_name=shuffled_items[0]['weights'])
|
| 51 |
pipe.fuse_lora(lora_1_scale)
|
|
|
|
| 62 |
|
| 63 |
def get_description(item):
|
| 64 |
trigger_word = item["trigger_word"]
|
| 65 |
+
return f"LoRA trigger word: `{trigger_word}`" if trigger_word else "No trigger word, will be applied automatically", trigger_word
|
| 66 |
|
| 67 |
def shuffle_images():
|
| 68 |
compatible_items = [item for item in sdxl_loras if item['is_compatible']]
|