Update src/pipeline.py
Browse files- src/pipeline.py +2 -2
src/pipeline.py
CHANGED
|
@@ -27,7 +27,7 @@ def load_pipeline() -> Pipeline:
|
|
| 27 |
path = os.path.join(HF_HUB_CACHE, "models--slobers--Flux.1.Schnella/snapshots/e34d670e44cecbbc90e4962e7aada2ac5ce8b55b/transformer")
|
| 28 |
transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False)
|
| 29 |
pipeline = FluxPipeline.from_pretrained(ckpt_id, revision=ckpt_revision, transformer=transformer, local_files_only=True, torch_dtype=torch.bfloat16,)
|
| 30 |
-
|
| 31 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
| 32 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_7_2k/snapshots/b7a5ce1313327009093d3178220267d0cf669b76")
|
| 33 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_8/snapshots/3666a458a53e7dc83adfecb0bf955a0b4d575843")
|
|
@@ -36,7 +36,7 @@ def load_pipeline() -> Pipeline:
|
|
| 36 |
# pipeline.vae.encoder.load_state_dict(torch.load(os.path.join(basepath, "encoder.pth")), strict=False)
|
| 37 |
# pipeline.vae.decoder.load_state_dict(torch.load(os.path.join(basepath, "decoder.pth")), strict=False)
|
| 38 |
quantize_(pipeline.vae, int8_weight_only())
|
| 39 |
-
|
| 40 |
for _ in range(3):
|
| 41 |
pipeline(prompt="insensible, timbale, pothery, electrovital, actinogram, taxis, intracerebellar, centrodesmus", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)
|
| 42 |
return pipeline
|
|
|
|
| 27 |
path = os.path.join(HF_HUB_CACHE, "models--slobers--Flux.1.Schnella/snapshots/e34d670e44cecbbc90e4962e7aada2ac5ce8b55b/transformer")
|
| 28 |
transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False)
|
| 29 |
pipeline = FluxPipeline.from_pretrained(ckpt_id, revision=ckpt_revision, transformer=transformer, local_files_only=True, torch_dtype=torch.bfloat16,)
|
| 30 |
+
|
| 31 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
| 32 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_7_2k/snapshots/b7a5ce1313327009093d3178220267d0cf669b76")
|
| 33 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_8/snapshots/3666a458a53e7dc83adfecb0bf955a0b4d575843")
|
|
|
|
| 36 |
# pipeline.vae.encoder.load_state_dict(torch.load(os.path.join(basepath, "encoder.pth")), strict=False)
|
| 37 |
# pipeline.vae.decoder.load_state_dict(torch.load(os.path.join(basepath, "decoder.pth")), strict=False)
|
| 38 |
quantize_(pipeline.vae, int8_weight_only())
|
| 39 |
+
pipeline.to("cuda")
|
| 40 |
for _ in range(3):
|
| 41 |
pipeline(prompt="insensible, timbale, pothery, electrovital, actinogram, taxis, intracerebellar, centrodesmus", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)
|
| 42 |
return pipeline
|