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

unipc schedule throws exception when use_karras_sigmas=True #4580

Closed
reimager opened this issue Aug 11, 2023 · 0 comments · Fixed by #4581
Closed

unipc schedule throws exception when use_karras_sigmas=True #4580

reimager opened this issue Aug 11, 2023 · 0 comments · Fixed by #4581
Labels
bug Something isn't working

Comments

@reimager
Copy link
Contributor

reimager commented Aug 11, 2023

Describe the bug

unipc scheduler throws exception when use_karras_sigmas=True

File "/usr/local/src/diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py", line 642, in call
self.scheduler.set_timesteps(num_inference_steps, device=device)
File "/usr/local/src/diffusers/src/diffusers/schedulers/scheduling_unipc_multistep.py", line 239, in set_timesteps
sigmas = self._convert_to_karras(in_sigmas=sigmas, num_inference_steps=num_inference_steps)
File "/usr/local/src/diffusers/src/diffusers/configuration_utils.py", line 137, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'UniPCMultistepScheduler' object has no attribute '_convert_to_karras'

Its just missing the _convert_to_karras and _sigma_to_t functions.
I will submit a pull request shortly

Reproduction

specify use_karras_sigmas=True when creating unipc scheduler, then use scheduler

Logs

No response

System Info

  • diffusers version: 0.19.3
  • Platform: Linux-5.10.0-23-amd64-x86_64-with-glibc2.35
  • Python version: 3.10.6
  • PyTorch version (GPU?): 2.1.0a0+b5021ba (True)
  • Huggingface_hub version: 0.16.4
  • Transformers version: 4.32.0.dev0
  • Accelerate version: 0.22.0.dev0
  • xFormers version: 0.0.21+db0e439.d20230810
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?: no

Who can help?

No response

@reimager reimager added the bug Something isn't working label Aug 11, 2023
reimager added a commit to reimager/diffusers that referenced this issue Aug 11, 2023
sayakpaul pushed a commit that referenced this issue Aug 16, 2023
* Fix unipc karras sigmas exception - fixes #4580

* Add unipc scheduler tests for karras sigmas
clrpackages pushed a commit to clearlinux-pkgs/pypi-diffusers that referenced this issue Aug 17, 2023
…ersion 0.20.0

Abhipsha Das (1):
      Remove code snippets containing `is_safetensors_available()` (#4521)

AisingioroHao (2):
      Add a data_dir parameter to the load_dataset method. (#4482)
      Fixed invalid pipeline_class_name parameter. (#4590)

Alan Ji (1):
      fix typo to ensure `make test-examples`  work correctly (#4329)

Andrey Voroshilov (1):
      Clean up duplicate lines in encode_prompt (#4369)

Batuhan Taskaya (1):
      Support higher dimension LoRAs (#4625)

Claire Froelich (1):
      Fix git-lfs command typo in docs  (#4586)

Dhruv Nair (9):
      Cleanup pass for flaky Slow Tests for Stable diffusion (#4415)
      move tests to nightly (#4451)
      Cleanup Pass on flaky slow tests for Stable Diffusion (#4455)
      Moving certain  pipelines slow tests to nightly  (#4469)
      fix indexing issue in sd reference pipeline (#4531)
      Move slow tests to nightly (#4526)
      pin ruff version for quality checks (#4539)
      Move controlnet load local tests to nightly (#4543)
      fix loading custom text encoder when using `from_single_file` (#4571)

Dirk Morris (1):
      Fix unipc use_karras_sigmas exception - fixes huggingface/diffusers#4580 (#4581)

Duong A. Nguyen (1):
      Fix SDXL conversion from original to diffusers (#4280)

Ella Charlaix (2):
      Fix typo documentation (#4320)
      Update documentation  (#4422)

George He (2):
      Fix typerror in pipeline handling for MultiControlNets which only contain a single ControlNet (#4454)
      Fix misc typos (#4479)

Harutatsu Akiyama (1):
      [SDXL-IP2P] Add gif for demonstrating training processes (#4342)

JinK (1):
      Support different strength for Stable Diffusion TensorRT Inpainting pipeline (#4216)

Levi McCallum (1):
      Add rank argument to train_dreambooth_lora_sdxl.py (#4343)

Mystfit (1):
      Fixing repo_id regex validation error on windows platforms (#4358)

Neil Wang (1):
      auto type conversion (#4270)

Nishant Rajadhyaksha (1):
      Update docs of unet_1d.py (#4394)

Patrick von Platen (18):
      0.20.0dev0 (#4299)
      [Torch.compile] Fixes torch compile graph break (#4315)
      [Local loading] Correct bug with local files only (#4318)
      [SDXL Refiner] Fix refiner forward pass for batched input (#4327)
      [ONNX] Don't download ONNX model by default (#4338)
      [SDXL] Make watermarker optional under certain circumstances to improve usability of SDXL 1.0 (#4346)
      [SDXL] Fix dummy imports incorrect naming (#4370)
      [AutoPipeline] Correct naming (#4420)
      fix make style
      make style
      add sdxl to prompt weighting (#4439)
      Update README_sdxl.md (#4472)
      [SDXL] Allow SDXL LoRA to be run with less than 16GB of VRAM (#4470)
      [SDXL LoRA] fix batch size lora (#4509)
      Make sure fp16-fix is used as default (#4510)
      move pipeline only when running validation (#4515)
      Revert "introduce minimalistic reimplementation of SDXL on the SDXL doc" (#4548)
      [Safetensors] Make safetensors the default way of saving weights (#4235)

Rastislav Švarba (1):
      Fix push_to_hub in train_text_to_image_lora_sdxl.py example (#4535)

Sayak Paul (24):
      [Tests] add test for pipeline import. (#4276)
      Honor the SDXL 1.0 licensing from the training scripts. (#4319)
      Update README_sdxl.md to correct the header (#4330)
      [Feat] Support SDXL Kohya-style LoRA (#4287)
      Update README.md to have PyPI-friendly path (#4351)
      minor doc fixes. (#4380)
      remove mentions of textual inversion from sdxl. (#4404)
      [LoRA] Fix SDXL text encoder LoRAs (#4371)
      [Feat] add tiny Autoencoder for (almost) instant decoding (#4384)
      [Tests] Adds integration tests for SDXL LoRAs (#4462)
      Update lora.md to clarify SDXL support  (#4503)
      Update README_sdxl.md to include the free-tier Colab Notebook (#4540)
      improve controlnet sdxl docs now that we have a good checkpoint. (#4556)
      [Examples] fix: network_alpha -> network_alphas (#4572)
      [Utility] adds an image grid utility (#4576)
      [Examples] Update InstructPix2Pix README_sdxl.md to fix mentions (#4574)
      [Pipeline utils] feat: implement push_to_hub for standalone models, schedulers as well as pipelines (#4128)
      [Docs] fix links in the controlling generation doc. (#4612)
      add: pushtohubmixin to pipelines and schedulers docs overview. (#4607)
      add: train to text image with sdxl script. (#4505)
      Update text2image.md to fix the links (#4626)
      [Core] feat: MultiControlNet support for SDXL ControlNet pipeline (#4597)
      make things clear in the controlnet sdxl doc. (#4644)
      Release: v0.20.0

Scott Lessans (1):
      Fix `UnboundLocalError` during LoRA loading (#4523)

Simo Ryu (1):
      introduce minimalistic reimplementation of SDXL on the SDXL doc (#4532)

Steven Liu (10):
      [docs] Fix SDXL docstring (#4397)
      [docs] AutoPipeline tutorial (#4273)
      [docs] Distilled SD (#4442)
      [docs] Clean scheduler api (#4204)
      [docs] Expand prompt weighting (#4516)
      [docs] Remove attention slicing (#4518)
      [docs] Add safetensors flag (#4245)
      [docs] Fix ControlNet SDXL docstring (#4582)
      [docs] PushToHubMixin (#4622)
      [docs] MultiControlNet (#4635)

Suraj Patil (1):
      [research_projects] SDXL controlnet script (#4633)

Tanupriya Singh (1):
      correct doc string for default value of guidance_scale (#4339)

VV-A-VV (2):
      Delete the duplicate code for the contolnet img 2 img (#4411)
      fix some typo error (#4546)

Vladislav Artemyev (1):
      Log global_step instead of epoch to tensorboard (#4493)

Wang Qiang (1):
      An invalid clerical error in sdxl finetune (#4608)

Will Berman (3):
      fix fp type in t2i adapter docs (#4350)
      train dreambooth fix pre encode class prompt (#4395)
      can call encode_prompt with out setting a text encoder instance variable (#4396)

Wooyeol Baek (1):
      Copy lora functions to XLPipelines (#4512)

Xin Kong (1):
      [Pipelines] Add community pipeline for Zero123 (#4295)

Xinyang Li (1):
      fix validation option for dreambooth training example (#4317)

YiYi Xu (8):
      update Kandinsky doc (#4301)
      fix a bug in StableDiffusionUpscalePipeline when `prompt` is `None` (#4278)
      support from_single_file for SDXL inpainting  (#4408)
      fix test_float16_inference (#4412)
      a few fix for kandinsky combined pipeline  (#4352)
      fix-format (#4458)
      add pipeline_class_name argument to Stable Diffusion conversion script (#4461)
      [Doc] update sdxl-controlnet repo name (#4564)

Yuyang Zhao (1):
      Fix bug caused by typo (#4357)

asfiyab-nvidia (1):
      TensorRT Inpaint pipeline: minor fixes (#4457)

cmdr2 (2):
      Accept pooled_prompt_embeds in the SDXL Controlnet pipeline. Fixes an error if prompt_embeds are passed. (#4309)
      Allow controlnets to be loaded (from ckpt) in a parallel thread with a SD model (ckpt), and speed it up slightly (#4298)

dotieuthien (1):
      Convert Stable Diffusion ControlNet to TensorRT (#4465)

estelleafl (1):
      [ldm3d] documentation fixing typos (#4284)

ethansmith2000 (1):
      grad checkpointing (#4474)

jere357 (1):
      Changed code that converts tensors to PIL images in the write_your_own_pipeline notebook (#4489)

kathath (1):
      Fix repeat of negative prompt (#4335)

manosplitsis (1):
      Fixed multi-token textual inversion training (#4452)

nikhil-masterful (1):
      Add GLIGEN implementation (#4441)

takuoko (1):
      [Examples] Support train_text_to_image_lora_sdxl.py (#4365)

w4ffl35 (1):
      Prevent online access when desired when using download_from_original_stable_diffusion_ckpt (#4271)
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this issue Dec 25, 2023
…ngface#4581)

* Fix unipc karras sigmas exception - fixes huggingface#4580

* Add unipc scheduler tests for karras sigmas
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this issue Apr 26, 2024
…ngface#4581)

* Fix unipc karras sigmas exception - fixes huggingface#4580

* Add unipc scheduler tests for karras sigmas
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.

1 participant