From e39204de120617830eea28842104ef936c1987a4 Mon Sep 17 00:00:00 2001 From: Jingyu Xin Date: Wed, 10 Sep 2025 20:53:01 +0000 Subject: [PATCH 1/2] Fixed the CICD for Diffusion Signed-off-by: jingyu Signed-off-by: Jingyu Xin --- examples/diffusers/quantization/diffusion_trt.py | 6 +++++- examples/diffusers/quantization/quantize.py | 8 ++++++-- examples/diffusers/quantization/requirements.txt | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/diffusers/quantization/diffusion_trt.py b/examples/diffusers/quantization/diffusion_trt.py index 4db12e9c2..1a0ec852d 100644 --- a/examples/diffusers/quantization/diffusion_trt.py +++ b/examples/diffusers/quantization/diffusion_trt.py @@ -105,7 +105,11 @@ def main(): image_name = args.save_image_as if args.save_image_as else f"{args.model}.png" - pipe = PipelineManager.create_pipeline_from(MODEL_ID[args.model], dtype_map[args.model_dtype]) + pipe = PipelineManager.create_pipeline_from( + MODEL_ID[args.model], + dtype_map[args.model_dtype], + override_model_path=args.override_model_path, + ) # Save the backbone of the pipeline and move it to the GPU add_embedding = None diff --git a/examples/diffusers/quantization/quantize.py b/examples/diffusers/quantization/quantize.py index 81c59392d..f94a4a1ad 100644 --- a/examples/diffusers/quantization/quantize.py +++ b/examples/diffusers/quantization/quantize.py @@ -309,7 +309,9 @@ def __init__(self, config: ModelConfig, logger: logging.Logger): @staticmethod def create_pipeline_from( - model_type: ModelType, torch_dtype: torch.dtype = torch.bfloat16 + model_type: ModelType, + torch_dtype: torch.dtype = torch.bfloat16, + override_model_path: str | None = None, ) -> DiffusionPipeline: """ Create and return an appropriate pipeline based on configuration. @@ -321,7 +323,9 @@ def create_pipeline_from( ValueError: If model type is unsupported """ try: - model_id = MODEL_REGISTRY[model_type] + model_id = ( + MODEL_REGISTRY[model_type] if override_model_path is None else override_model_path + ) if model_type == ModelType.SD3_MEDIUM: pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch_dtype) elif model_type in [ModelType.FLUX_DEV, ModelType.FLUX_SCHNELL]: diff --git a/examples/diffusers/quantization/requirements.txt b/examples/diffusers/quantization/requirements.txt index 9c9a60b86..35d2ca4a0 100644 --- a/examples/diffusers/quantization/requirements.txt +++ b/examples/diffusers/quantization/requirements.txt @@ -1,4 +1,5 @@ cuda-python +diffusers==0.34.0 nvtx onnx_graphsurgeon opencv-python>=4.8.1.78,<4.12.0.88 From 43ed09f5896288f91dc6f1d11f696771575ed59a Mon Sep 17 00:00:00 2001 From: Jingyu Xin Date: Wed, 10 Sep 2025 21:01:13 +0000 Subject: [PATCH 2/2] Update req for diffusers Signed-off-by: Jingyu Xin --- examples/diffusers/quantization/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/diffusers/quantization/requirements.txt b/examples/diffusers/quantization/requirements.txt index 35d2ca4a0..52921fe74 100644 --- a/examples/diffusers/quantization/requirements.txt +++ b/examples/diffusers/quantization/requirements.txt @@ -1,5 +1,5 @@ cuda-python -diffusers==0.34.0 +diffusers<=0.34.0 nvtx onnx_graphsurgeon opencv-python>=4.8.1.78,<4.12.0.88