Update src/pipeline.py
Browse files- src/pipeline.py +3 -2
src/pipeline.py
CHANGED
|
@@ -595,7 +595,7 @@ def load_pipeline() -> Pipeline:
|
|
| 595 |
).to(memory_format=torch.channels_last)
|
| 596 |
|
| 597 |
vae = AutoencoderTiny.from_pretrained("RobertML/FLUX.1-schnell-vae_e3m2", revision="da0d2cd7815792fb40d084dbd8ed32b63f153d8d", torch_dtype=dtype)
|
| 598 |
-
|
| 599 |
path = os.path.join(HF_HUB_CACHE, "models--RobertML--FLUX.1-schnell-int8wo/snapshots/307e0777d92df966a3c0f99f31a6ee8957a9857a")
|
| 600 |
generator = torch.Generator(device=device)
|
| 601 |
model = FluxTransformer2DModel.from_pretrained(path, torch_dtype=dtype, use_safetensors=False, generator= generator).to(memory_format=torch.channels_last)
|
|
@@ -608,7 +608,8 @@ def load_pipeline() -> Pipeline:
|
|
| 608 |
transformer=model,
|
| 609 |
text_encoder_2=text_encoder_2,
|
| 610 |
torch_dtype=dtype,
|
| 611 |
-
).to(device
|
|
|
|
| 612 |
for _ in range(3):
|
| 613 |
pipeline(prompt="blah blah waah waah oneshot oneshot gang gang", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)
|
| 614 |
|
|
|
|
| 595 |
).to(memory_format=torch.channels_last)
|
| 596 |
|
| 597 |
vae = AutoencoderTiny.from_pretrained("RobertML/FLUX.1-schnell-vae_e3m2", revision="da0d2cd7815792fb40d084dbd8ed32b63f153d8d", torch_dtype=dtype)
|
| 598 |
+
|
| 599 |
path = os.path.join(HF_HUB_CACHE, "models--RobertML--FLUX.1-schnell-int8wo/snapshots/307e0777d92df966a3c0f99f31a6ee8957a9857a")
|
| 600 |
generator = torch.Generator(device=device)
|
| 601 |
model = FluxTransformer2DModel.from_pretrained(path, torch_dtype=dtype, use_safetensors=False, generator= generator).to(memory_format=torch.channels_last)
|
|
|
|
| 608 |
transformer=model,
|
| 609 |
text_encoder_2=text_encoder_2,
|
| 610 |
torch_dtype=dtype,
|
| 611 |
+
).to(device
|
| 612 |
+
pipeline.vae = torch.compile(pipeline.vae)
|
| 613 |
for _ in range(3):
|
| 614 |
pipeline(prompt="blah blah waah waah oneshot oneshot gang gang", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)
|
| 615 |
|