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

use StableDiffusionXLPipeline_HPU #1300

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jianhong-Zhang
Copy link
Contributor

@Jianhong-Zhang Jianhong-Zhang commented Aug 30, 2024

use StableDiffusionXLPipeline_HPU for SDXL

@imangohari1
Copy link
Contributor

hi @Jianhong-Zhang
what's the status of this PR? Could you rebase/sync this with main OH, and share some comments/description on what does this PR do with some results?
Thanks.

Copy link
Contributor

@imangohari1 imangohari1 left a comment

Choose a reason for hiding this comment

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

This PR needs some work:

  • I made some changes that are needed. Pls. Apply the patch via git am <0001*
    0001-fea-fixes.patch
  • The StableDiffusionXLPipeline_HPU crashes with below error. Pls address.
    This PR can't be merged right now.
python text_to_image_generation.py     --model_name_or_path stabilityai/stable-diffusion-xl-base-1.0     --prompts "Sailing ship painting by Van Gogh"     --num_images_per_prompt 28     --batch_size 7     --image_save_dir /tmp/stable_diffusion_xl_images     --scheduler euler_discrete     --use_habana     --use_hpu_graphs     --gaudi_config Habana/stable-diffusion     --bf16 --sdxl_mlperf
Traceback (most recent call last):
  File "/devops/sgohari/tests/codes/pr-reviews/1300/optimum-habana/examples/stable-diffusion/text_to_image_generation.py", line 549, in <module>
    main()
  File "/devops/sgohari/tests/codes/pr-reviews/1300/optimum-habana/examples/stable-diffusion/text_to_image_generation.py", line 518, in main
    outputs = pipeline(prompt=args.prompts, **kwargs_call)
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_mlperf.py", line 599, in __call__
    if self.quantized:
  File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 143, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'StableDiffusionXLPipeline_HPU' object has no attribute 'quantized'

@imangohari1
Copy link
Contributor

@Jianhong-Zhang
Any update on this PR please? could you address my comments here? Thanks.

This PR needs some work:

* I made some changes that are needed. Pls. Apply the patch via `git am <0001*`
  [0001-fea-fixes.patch](https://github.com/user-attachments/files/16984799/0001-fea-fixes.patch)

* The `StableDiffusionXLPipeline_HPU` crashes with below error. Pls address.
  This PR can't be merged right now.
python text_to_image_generation.py     --model_name_or_path stabilityai/stable-diffusion-xl-base-1.0     --prompts "Sailing ship painting by Van Gogh"     --num_images_per_prompt 28     --batch_size 7     --image_save_dir /tmp/stable_diffusion_xl_images     --scheduler euler_discrete     --use_habana     --use_hpu_graphs     --gaudi_config Habana/stable-diffusion     --bf16 --sdxl_mlperf
Traceback (most recent call last):
  File "/devops/sgohari/tests/codes/pr-reviews/1300/optimum-habana/examples/stable-diffusion/text_to_image_generation.py", line 549, in <module>
    main()
  File "/devops/sgohari/tests/codes/pr-reviews/1300/optimum-habana/examples/stable-diffusion/text_to_image_generation.py", line 518, in main
    outputs = pipeline(prompt=args.prompts, **kwargs_call)
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_mlperf.py", line 599, in __call__
    if self.quantized:
  File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 143, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'StableDiffusionXLPipeline_HPU' object has no attribute 'quantized'

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.

2 participants