Update src/pipeline.py
Browse files- src/pipeline.py +3 -2
src/pipeline.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
#7
|
2 |
from huggingface_hub.constants import HF_HUB_CACHE
|
3 |
from transformers import T5EncoderModel, T5TokenizerFast, CLIPTokenizer, CLIPTextModel
|
4 |
import torch
|
5 |
import torch._dynamo
|
6 |
import gc
|
7 |
import os
|
8 |
-
from diffusers import FluxPipeline,
|
9 |
from PIL.Image import Image
|
10 |
from pipelines.models import TextToImageRequest
|
11 |
from torch import Generator
|
@@ -27,6 +27,7 @@ def load_pipeline() -> Pipeline:
|
|
27 |
pipeline.to("cuda")
|
28 |
quantize_(pipeline.vae, int8_weight_only())
|
29 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
|
|
30 |
for _ in range(3):
|
31 |
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)
|
32 |
return pipeline
|
|
|
1 |
+
#7.1
|
2 |
from huggingface_hub.constants import HF_HUB_CACHE
|
3 |
from transformers import T5EncoderModel, T5TokenizerFast, CLIPTokenizer, CLIPTextModel
|
4 |
import torch
|
5 |
import torch._dynamo
|
6 |
import gc
|
7 |
import os
|
8 |
+
from diffusers import FluxPipeline, AutoencoderTiny
|
9 |
from PIL.Image import Image
|
10 |
from pipelines.models import TextToImageRequest
|
11 |
from torch import Generator
|
|
|
27 |
pipeline.to("cuda")
|
28 |
quantize_(pipeline.vae, int8_weight_only())
|
29 |
pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)
|
30 |
+
pipeline.vae = torch.compile(pipeline.vae, mode="max-autotune", fullgraph=True, dynamic=True)
|
31 |
for _ in range(3):
|
32 |
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)
|
33 |
return pipeline
|