Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TensorRTStableDiffusionPipeline cannot set guidance_scale #7065

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

caiyueliang
Copy link
Contributor

What does this PR do?

fix the bug when I use custom pipeline: TensorRTStableDiffusionPipeline:

Traceback (most recent call last):
  File "exchange_torch2trt.py", line 93, in <module>
    gen_image(pipe=pipe, prompt=prompt, negative_prompt=neg_prompt)
  File "exchange_torch2trt.py", line 72, in gen_image
    image = pipe(prompt, negative_prompt=negative_prompt).images[0]
  File "/usr/local/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/root/.cache/huggingface/modules/diffusers_modules/local/stable_diffusion_tensorrt_txt2img.py", line 885, in __call__
    self.guidance_scale = guidance_scale
  File "/usr/local/lib/python3.8/site-packages/diffusers/pipelines/pipeline_utils.py", line 622, in __setattr__
    super().__setattr__(name, value)
AttributeError: can't set attribute

The solution is to refer to the: #6326
And it has been verified that it can operate normally.

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yiyixuxu yiyixuxu merged commit c09bb58 into huggingface:main Feb 24, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants