Spaces:
Configuration error
Configuration error
Commit ·
9cedc4a
1
Parent(s): 1b1b7c9
spacesgpu
Browse files
app.py
CHANGED
|
@@ -110,6 +110,10 @@ def generate_flux_image(
|
|
| 110 |
joint_attention_kwargs={"scale": lora_scale},
|
| 111 |
).images[0]
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
# Save the generated image
|
| 114 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 115 |
unique_id = str(uuid.uuid4())[:8]
|
|
|
|
| 110 |
joint_attention_kwargs={"scale": lora_scale},
|
| 111 |
).images[0]
|
| 112 |
|
| 113 |
+
# Move model to CPU after generation
|
| 114 |
+
flux_pipeline.to("cpu")
|
| 115 |
+
torch.cuda.empty_cache()
|
| 116 |
+
|
| 117 |
# Save the generated image
|
| 118 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 119 |
unique_id = str(uuid.uuid4())[:8]
|