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

[ONNX] Long prompt weight community pipeline rasies error when using LMS discrete scheduler #1363

Closed
azuritecoin opened this issue Nov 21, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@azuritecoin
Copy link

azuritecoin commented Nov 21, 2022

Describe the bug

When using ONNX with the custom pipeline lpw_stable_diffusion_onnx it raises a "unsupported operand" error. It's the same error as this other bug #967

Reproduction

from diffusers import OnnxStableDiffusionPipeline, DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler

model_path = "model/stable_diffusion_onnx"
scheduler = LMSDiscreteScheduler.from_pretrained(model_path, subfolder="scheduler")

pipe = OnnxStableDiffusionPipeline.from_pretrained(
    model_path, scheduler=scheduler, custom_pipeline="lpw_stable_diffusion_onnx")

images = pipe(
    "an astronaut riding a horse on Mars", height=512, width=512, num_inference_steps=25, guidance_scale=7.5).images

images[0].save("output.png")

Logs

D:\test_stable_diff\virtualenv\lib\site-packages\huggingface_hub\file_download.py:588: FutureWarning: `cached_download` is the legacy way to download files from the HF hub, please consider upgrading to `hf_hub_download`
  warnings.warn(
Traceback (most recent call last):
  File "D:\test_stable_diff\lpw_onnx.py", line 16, in <module>
    images = pipe(
  File "D:\test_stable_diff\virtualenv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\sam/.cache\huggingface\modules\diffusers_modules\git\lpw_stable_diffusion_onnx.py", line 617, in __call__
    latents = latents * self.scheduler.init_noise_sigma
TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'Tensor'

System Info

  • diffusers version: 0.8.0.dev0
  • Platform: Windows-10-10.0.19044-SP0
  • Python version: 3.10.8
  • PyTorch version (GPU?): 1.13.0+cpu (False)
  • Huggingface_hub version: 0.10.1
  • Transformers version: 4.24.0
  • Using GPU in script?: no
  • Using distributed or parallel set-up in script?: no
@anton-l
Copy link
Member

anton-l commented Dec 12, 2022

Fixed by #1570

@anton-l anton-l closed this as completed Dec 12, 2022
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

No branches or pull requests

2 participants