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

enable_vae_tiling is not found SD image to image and inpaint pipeline #6870

Closed
MrSyee opened this issue Feb 6, 2024 · 2 comments · Fixed by #6871
Closed

enable_vae_tiling is not found SD image to image and inpaint pipeline #6870

MrSyee opened this issue Feb 6, 2024 · 2 comments · Fixed by #6871
Labels
bug Something isn't working

Comments

@MrSyee
Copy link
Contributor

MrSyee commented Feb 6, 2024

Describe the bug

I tried to use vae_tiling in StableDiffusionImg2ImgPipeline and StableDiffusionInpaintPipeline, but the function was not defined. This option is probably needed to save memory when generating large images.

I noticed that it is enabled for StableDiffusionPipeline and ControlNet Pipeline. Is there any other reason why you didn't apply it to Img2Img?
If there are no major issues, I'd like to see it applied and I'll try to create a PR.

Thank you!

Reproduction

import torch
from diffusers import AutoPipelineForImage2Image

pipe = AutoPipelineForImage2Image.from_pretrained(
    "runwayml/stable-diffusion-v1-5",
    torch_dtype=torch.float16,
    use_safetensors=True,
).to("cuda")
pipe.enable_vae_tiling()

Logs

Loading pipeline components...:   0%|                                                                                                                                                                                  | 0/7 [00:00<?, ?it/s]`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:12<00:00,  1.82s/it]
Traceback (most recent call last):
  File "/home/khwankim_dc/workspace/project/sea_drawing/test.py", line 9, in <module>
    pipe.enable_vae_tiling()
  File "/home/khwankim_dc/.pyenv/versions/project/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 138, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'StableDiffusionImg2ImgPipeline' object has no attribute 'enable_vae_tiling'

System Info

  • diffusers version: 0.24.0
  • Platform: Linux-5.4.0-65-generic-x86_64-with-glibc2.31
  • Python version: 3.10.13
  • PyTorch version (GPU?): 2.0.1+cu117 (True)
  • Huggingface_hub version: 0.20.3
  • Transformers version: 4.35.2
  • Accelerate version: 0.24.1
  • xFormers version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

@yiyixuxu @DN6 @sayakpaul @patrickvonplaten

@MrSyee MrSyee added the bug Something isn't working label Feb 6, 2024
@sayakpaul
Copy link
Member

That is because StableDiffusionImg2ImgPipeline doesn't have the method implemented: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py. Would you be willing to open a PR?

@MrSyee
Copy link
Contributor Author

MrSyee commented Feb 6, 2024

That is because StableDiffusionImg2ImgPipeline doesn't have the method implemented: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py. Would you be willing to open a PR?

@sayakpaul I've opend PR. Please check this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants