Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -104,7 +104,7 @@ def generate_image(orginal_image, prompt, adapter_names, steps, seed, image_str
|
|
104 |
generator=generator,
|
105 |
joint_attention_kwargs=joint_attention_kwargs
|
106 |
).images[0]
|
107 |
-
|
108 |
progress(99, "Generate image success!")
|
109 |
return generated_image
|
110 |
|
@@ -150,7 +150,7 @@ def upload_image_to_r2(image, account_id, access_key, secret_key, bucket_name):
|
|
150 |
def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, steps, randomize_seed, seed, width, height, upload_to_r2, account_id, access_key, secret_key, bucket, progress=gr.Progress(track_tqdm=True)):
|
151 |
print("run_lora", prompt, lora_strings_json, cfg_scale, steps, width, height)
|
152 |
gr.Info("Starting process")
|
153 |
-
|
154 |
img2img_model = False
|
155 |
orginal_image = None
|
156 |
if image_url:
|
|
|
104 |
generator=generator,
|
105 |
joint_attention_kwargs=joint_attention_kwargs
|
106 |
).images[0]
|
107 |
+
torch.cuda.empty_cache()
|
108 |
progress(99, "Generate image success!")
|
109 |
return generated_image
|
110 |
|
|
|
150 |
def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, steps, randomize_seed, seed, width, height, upload_to_r2, account_id, access_key, secret_key, bucket, progress=gr.Progress(track_tqdm=True)):
|
151 |
print("run_lora", prompt, lora_strings_json, cfg_scale, steps, width, height)
|
152 |
gr.Info("Starting process")
|
153 |
+
torch.cuda.empty_cache()
|
154 |
img2img_model = False
|
155 |
orginal_image = None
|
156 |
if image_url:
|