Upload handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
|
@@ -22,10 +22,10 @@ class EndpointHandler:
|
|
| 22 |
repo_id = "camenduru/FLUX.1-dev-diffusers"
|
| 23 |
#repo_id = "NoMoreCopyright/FLUX.1-dev-test"
|
| 24 |
dtype = torch.bfloat16
|
| 25 |
-
quantization_config = TorchAoConfig("
|
| 26 |
vae = AutoencoderKL.from_pretrained(repo_id, subfolder="vae", torch_dtype=dtype)
|
| 27 |
-
transformer = FluxTransformer2DModel.from_pretrained(repo_id, subfolder="transformer", torch_dtype=dtype, quantization_config=quantization_config).to("cuda")
|
| 28 |
-
self.pipeline = FluxPipeline.from_pretrained(repo_id,
|
| 29 |
if is_compile: self.pipeline = compile_pipeline(self.pipeline)
|
| 30 |
self.pipeline.to("cuda")
|
| 31 |
|
|
|
|
| 22 |
repo_id = "camenduru/FLUX.1-dev-diffusers"
|
| 23 |
#repo_id = "NoMoreCopyright/FLUX.1-dev-test"
|
| 24 |
dtype = torch.bfloat16
|
| 25 |
+
quantization_config = TorchAoConfig("int8wo")
|
| 26 |
vae = AutoencoderKL.from_pretrained(repo_id, subfolder="vae", torch_dtype=dtype)
|
| 27 |
+
#transformer = FluxTransformer2DModel.from_pretrained(repo_id, subfolder="transformer", torch_dtype=dtype, quantization_config=quantization_config).to("cuda")
|
| 28 |
+
self.pipeline = FluxPipeline.from_pretrained(repo_id, vae=vae, torch_dtype=dtype, quantization_config=quantization_config)
|
| 29 |
if is_compile: self.pipeline = compile_pipeline(self.pipeline)
|
| 30 |
self.pipeline.to("cuda")
|
| 31 |
|