Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,12 @@ base_path = "black-forest-labs/FLUX.1-dev"
|
|
| 17 |
lora_base_path = "./models"
|
| 18 |
|
| 19 |
|
| 20 |
-
pipe = FluxPipeline.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
transformer = FluxTransformer2DModel.from_pretrained(base_path, subfolder="transformer", torch_dtype=torch.bfloat16)
|
| 22 |
pipe.transformer = transformer
|
| 23 |
pipe.to("cuda")
|
|
|
|
| 17 |
lora_base_path = "./models"
|
| 18 |
|
| 19 |
|
| 20 |
+
pipe = FluxPipeline.from_pretrained(
|
| 21 |
+
base_path,
|
| 22 |
+
torch_dtype=torch.bfloat16,
|
| 23 |
+
device_map="balanced",
|
| 24 |
+
max_memory={0:"16GB", 1:"16GB"}
|
| 25 |
+
)
|
| 26 |
transformer = FluxTransformer2DModel.from_pretrained(base_path, subfolder="transformer", torch_dtype=torch.bfloat16)
|
| 27 |
pipe.transformer = transformer
|
| 28 |
pipe.to("cuda")
|