Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
e99cabf
1
Parent(s):
ea9cf68
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,10 @@ from optimum.quanto import freeze, qfloat8, quantize
|
|
22 |
#quantize(controlnet, weights=qfloat8)
|
23 |
#freeze(controlnet)
|
24 |
|
|
|
|
|
|
|
|
|
25 |
text_encoder_2 = T5EncoderModel.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="text_encoder_2", torch_dtype=torch.bfloat16)
|
26 |
quantize(text_encoder_2, weights=qfloat8)
|
27 |
freeze(text_encoder_2)
|
@@ -29,6 +33,7 @@ freeze(text_encoder_2)
|
|
29 |
pipe = FluxControlNetInpaintingPipeline.from_pretrained(
|
30 |
"black-forest-labs/FLUX.1-dev",
|
31 |
text_encoder_2=None,
|
|
|
32 |
torch_dtype=torch.bfloat16
|
33 |
)
|
34 |
pipe.text_encoder_2 = text_encoder_2
|
|
|
22 |
#quantize(controlnet, weights=qfloat8)
|
23 |
#freeze(controlnet)
|
24 |
|
25 |
+
transformer = FluxTransformer2DModel.from_pretrained(
|
26 |
+
"black-forest-labs/FLUX.1-dev", subfolder='transformer', torch_dtype=torch.bfloat16
|
27 |
+
)
|
28 |
+
|
29 |
text_encoder_2 = T5EncoderModel.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="text_encoder_2", torch_dtype=torch.bfloat16)
|
30 |
quantize(text_encoder_2, weights=qfloat8)
|
31 |
freeze(text_encoder_2)
|
|
|
33 |
pipe = FluxControlNetInpaintingPipeline.from_pretrained(
|
34 |
"black-forest-labs/FLUX.1-dev",
|
35 |
text_encoder_2=None,
|
36 |
+
transformer=transformer,
|
37 |
torch_dtype=torch.bfloat16
|
38 |
)
|
39 |
pipe.text_encoder_2 = text_encoder_2
|