Spaces:
Runtime error
Runtime error
Commit
·
4669ef8
1
Parent(s):
c2e1098
update
Browse files- app.py +3 -1
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -75,7 +75,8 @@ def init():
|
|
| 75 |
).to(DEVICE)
|
| 76 |
pipe.text_encoder_2 = text_encoder_2
|
| 77 |
pipe.transformer = transformer
|
| 78 |
-
|
|
|
|
| 79 |
|
| 80 |
# generator = torch.Generator().manual_seed(12345)
|
| 81 |
# image = pipe(
|
|
@@ -194,4 +195,5 @@ with gr.Blocks(css=css) as demo:
|
|
| 194 |
outputs = [result, seed]
|
| 195 |
)
|
| 196 |
|
|
|
|
| 197 |
demo.launch()
|
|
|
|
| 75 |
).to(DEVICE)
|
| 76 |
pipe.text_encoder_2 = text_encoder_2
|
| 77 |
pipe.transformer = transformer
|
| 78 |
+
if DEVICE == "cuda":
|
| 79 |
+
pipe.enable_model_cpu_offload()
|
| 80 |
|
| 81 |
# generator = torch.Generator().manual_seed(12345)
|
| 82 |
# image = pipe(
|
|
|
|
| 195 |
outputs = [result, seed]
|
| 196 |
)
|
| 197 |
|
| 198 |
+
init()
|
| 199 |
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
accelerate
|
| 2 |
#git+https://github.com/huggingface/diffusers.git@flux-pipeline
|
| 3 |
-
|
| 4 |
-
git+https://github.com/huggingface/diffusers.git
|
| 5 |
invisible_watermark
|
| 6 |
#torch
|
| 7 |
transformers==4.42.4
|
|
|
|
| 1 |
accelerate
|
| 2 |
#git+https://github.com/huggingface/diffusers.git@flux-pipeline
|
| 3 |
+
git+https://github.com/peanutcocktail/diffusers.git
|
| 4 |
+
#git+https://github.com/huggingface/diffusers.git
|
| 5 |
invisible_watermark
|
| 6 |
#torch
|
| 7 |
transformers==4.42.4
|