Update src/pipeline.py
Browse files- src/pipeline.py +3 -3
src/pipeline.py
CHANGED
@@ -22,10 +22,10 @@ ckpt_revision = "cb1b599b0d712b9aab2c4df3ad27b050a27ec146"
|
|
22 |
|
23 |
|
24 |
def load_pipeline() -> Pipeline:
|
25 |
-
path = os.path.join(HF_HUB_CACHE, "models--
|
26 |
transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False)
|
27 |
pipeline = FluxPipeline.from_pretrained(ckpt_id, revision=ckpt_revision, transformer=transformer, local_files_only=True, torch_dtype=torch.bfloat16,)
|
28 |
-
|
29 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
30 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_7_2k/snapshots/b7a5ce1313327009093d3178220267d0cf669b76")
|
31 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_8/snapshots/3666a458a53e7dc83adfecb0bf955a0b4d575843")
|
@@ -34,7 +34,7 @@ def load_pipeline() -> Pipeline:
|
|
34 |
# pipeline.vae.encoder.load_state_dict(torch.load(os.path.join(basepath, "encoder.pth")), strict=False)
|
35 |
# pipeline.vae.decoder.load_state_dict(torch.load(os.path.join(basepath, "decoder.pth")), strict=False)
|
36 |
quantize_(pipeline.vae, int8_weight_only())
|
37 |
-
|
38 |
for _ in range(3):
|
39 |
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)
|
40 |
return pipeline
|
|
|
22 |
|
23 |
|
24 |
def load_pipeline() -> Pipeline:
|
25 |
+
path = os.path.join(HF_HUB_CACHE, "models--manbeast3b--flux.1-schnell-full1/snapshots/cb1b599b0d712b9aab2c4df3ad27b050a27ec146/transformer")
|
26 |
transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False)
|
27 |
pipeline = FluxPipeline.from_pretrained(ckpt_id, revision=ckpt_revision, transformer=transformer, local_files_only=True, torch_dtype=torch.bfloat16,)
|
28 |
+
pipeline.to("cuda")
|
29 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
30 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_7_2k/snapshots/b7a5ce1313327009093d3178220267d0cf669b76")
|
31 |
# basepath = os.path.join(HF_HUB_CACHE, "models--manbeast3b--Flux.1.schnell_eagle5_1_0.1_unst_8/snapshots/3666a458a53e7dc83adfecb0bf955a0b4d575843")
|
|
|
34 |
# pipeline.vae.encoder.load_state_dict(torch.load(os.path.join(basepath, "encoder.pth")), strict=False)
|
35 |
# pipeline.vae.decoder.load_state_dict(torch.load(os.path.join(basepath, "decoder.pth")), strict=False)
|
36 |
quantize_(pipeline.vae, int8_weight_only())
|
37 |
+
|
38 |
for _ in range(3):
|
39 |
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)
|
40 |
return pipeline
|