Got it
Browse files- src/pipeline.py +7 -4
src/pipeline.py
CHANGED
@@ -14,6 +14,11 @@ from transformers import T5EncoderModel, CLIPTextModel
|
|
14 |
|
15 |
Pipeline: TypeAlias = FluxPipeline
|
16 |
torch.backends.cudnn.benchmark = True
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
CHECKPOINT = "jokerbit/flux.1-schnell-Robert-int8wo"
|
19 |
REVISION = "5ef0012f11a863e5111ec56540302a023bc8587b"
|
@@ -28,7 +33,7 @@ def load_pipeline() -> Pipeline:
|
|
28 |
path,
|
29 |
use_safetensors=False,
|
30 |
local_files_only=True,
|
31 |
-
torch_dtype=torch.bfloat16)
|
32 |
vae = AutoencoderTiny.from_pretrained(
|
33 |
TinyVAE,
|
34 |
revision=TinyVAE_REV,
|
@@ -44,10 +49,8 @@ def load_pipeline() -> Pipeline:
|
|
44 |
torch_dtype=torch.bfloat16,
|
45 |
)
|
46 |
|
47 |
-
pipeline.to(memory_format=torch.channels_last)
|
48 |
-
pipeline.enable_vae_slicing()
|
49 |
pipeline.to("cuda")
|
50 |
-
# quantize_(pipeline.vae, int8_weight_only())
|
51 |
for _ in range(4):
|
52 |
pipeline("cat", num_inference_steps=4)
|
53 |
|
|
|
14 |
|
15 |
Pipeline: TypeAlias = FluxPipeline
|
16 |
torch.backends.cudnn.benchmark = True
|
17 |
+
torch._inductor.config.conv_1x1_as_mm = True
|
18 |
+
torch._inductor.config.coordinate_descent_tuning = True
|
19 |
+
torch._inductor.config.epilogue_fusion = False
|
20 |
+
torch._inductor.config.coordinate_descent_check_all_directions = True
|
21 |
+
os.environ['PYTORCH_CUDA_ALLOC_CONF']="expandable_segments:True"
|
22 |
|
23 |
CHECKPOINT = "jokerbit/flux.1-schnell-Robert-int8wo"
|
24 |
REVISION = "5ef0012f11a863e5111ec56540302a023bc8587b"
|
|
|
33 |
path,
|
34 |
use_safetensors=False,
|
35 |
local_files_only=True,
|
36 |
+
torch_dtype=torch.bfloat16)
|
37 |
vae = AutoencoderTiny.from_pretrained(
|
38 |
TinyVAE,
|
39 |
revision=TinyVAE_REV,
|
|
|
49 |
torch_dtype=torch.bfloat16,
|
50 |
)
|
51 |
|
52 |
+
pipeline.transformer.to(memory_format=torch.channels_last)
|
|
|
53 |
pipeline.to("cuda")
|
|
|
54 |
for _ in range(4):
|
55 |
pipeline("cat", num_inference_steps=4)
|
56 |
|