Skip to content

TensorRTStableDiffusionImg2ImgPipeline: can't set attribute 'guidance_scale' #6323

@Jannchie

Description

@Jannchie

Describe the bug

guidance_scale became a not setable prop. So this example will report an error.

Reproduction

I'm using the example code:

https://github.com/huggingface/diffusers/blob/main/examples/community/README.md#tensorrt-image2image-stable-diffusion-pipeline

Logs

Traceback (most recent call last):
  File "C:\Code\diffusers-playground\img2img\sdt.py", line 41, in <module>
    image = pipe(
  File "C:\Users\Jannchie\anaconda3\envs\streamdiffusion\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Code\diffusers-playground\img2img\utils\__init__.py", line 1007, in __call__
    self.guidance_scale = guidance_scale
  File "C:\Users\Jannchie\anaconda3\envs\streamdiffusion\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 607, in __setattr__
    super().__setattr__(name, value)
AttributeError: can't set attribute 'guidance_scale'


### System Info

- `diffusers` version: 0.24.0
- Platform: Windows-10-10.0.22631-SP0
- Python version: 3.10.13
- PyTorch version (GPU?): 2.1.0+cu121 (True)
- Huggingface_hub version: 0.20.1
- Transformers version: 4.36.2
- Accelerate version: 0.25.0
- xFormers version: 0.0.22.post7
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions