Commit
·
735a271
1
Parent(s):
3afe580
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,7 +53,7 @@ for item in sdxl_loras:
|
|
| 53 |
if not saved_name.endswith('.safetensors'):
|
| 54 |
state_dict = torch.load(saved_name, map_location=torch.device('cpu'))
|
| 55 |
else:
|
| 56 |
-
state_dict = load_file(saved_name)
|
| 57 |
|
| 58 |
state_dicts[item["repo"]] = {
|
| 59 |
"saved_name": saved_name,
|
|
@@ -94,8 +94,8 @@ def merge_and_run(prompt, negative_prompt, shuffled_items, lora_1_scale=0.5, lor
|
|
| 94 |
repo_id_1 = shuffled_items[0]['repo']
|
| 95 |
repo_id_2 = shuffled_items[1]['repo']
|
| 96 |
print("Loading state dicts...")
|
| 97 |
-
state_dict_1 = copy.deepcopy(state_dicts[repo_id_1]["state_dict"])
|
| 98 |
-
state_dict_2 = copy.deepcopy(state_dicts[repo_id_2]["state_dict"])
|
| 99 |
print("Loaded state dicts.")
|
| 100 |
pipe = copy.deepcopy(original_pipe)
|
| 101 |
pipe.to("cuda")
|
|
|
|
| 53 |
if not saved_name.endswith('.safetensors'):
|
| 54 |
state_dict = torch.load(saved_name, map_location=torch.device('cpu'))
|
| 55 |
else:
|
| 56 |
+
state_dict = load_file(saved_name, device="cpu")
|
| 57 |
|
| 58 |
state_dicts[item["repo"]] = {
|
| 59 |
"saved_name": saved_name,
|
|
|
|
| 94 |
repo_id_1 = shuffled_items[0]['repo']
|
| 95 |
repo_id_2 = shuffled_items[1]['repo']
|
| 96 |
print("Loading state dicts...")
|
| 97 |
+
state_dict_1 = copy.deepcopy(state_dicts[repo_id_1]["state_dict"].to("cuda"))
|
| 98 |
+
state_dict_2 = copy.deepcopy(state_dicts[repo_id_2]["state_dict"].to("cuda"))
|
| 99 |
print("Loaded state dicts.")
|
| 100 |
pipe = copy.deepcopy(original_pipe)
|
| 101 |
pipe.to("cuda")
|