Spaces:
Runtime error
Runtime error
Commit
·
008aa9b
1
Parent(s):
2d962f0
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ for item in sdxl_loras:
|
|
| 38 |
state_dict = torch.load(saved_name)
|
| 39 |
|
| 40 |
item["saved_name"] = saved_name
|
| 41 |
-
item["state_dict"] =
|
| 42 |
|
| 43 |
css = '''
|
| 44 |
#title{text-align:center;}
|
|
@@ -58,8 +58,8 @@ css = '''
|
|
| 58 |
original_pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
|
| 59 |
|
| 60 |
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)):
|
| 61 |
-
state_dict_1 = shuffled_items[0]['state_dict']
|
| 62 |
-
state_dict_2 = shuffled_items[1]['state_dict']
|
| 63 |
pipe = copy.deepcopy(original_pipe)
|
| 64 |
pipe.to("cuda")
|
| 65 |
|
|
|
|
| 38 |
state_dict = torch.load(saved_name)
|
| 39 |
|
| 40 |
item["saved_name"] = saved_name
|
| 41 |
+
item["state_dict"] = state_dict #{k: v.to(device="cuda", dtype=torch.float16) for k, v in state_dict.items() if torch.is_tensor(v)}
|
| 42 |
|
| 43 |
css = '''
|
| 44 |
#title{text-align:center;}
|
|
|
|
| 58 |
original_pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
|
| 59 |
|
| 60 |
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)):
|
| 61 |
+
state_dict_1 = copy.deepcopy(shuffled_items[0]['state_dict'])
|
| 62 |
+
state_dict_2 = copy.deepcopy(shuffled_items[1]['state_dict'])
|
| 63 |
pipe = copy.deepcopy(original_pipe)
|
| 64 |
pipe.to("cuda")
|
| 65 |
|