Skip to content

Stable Diffusion v1-3 crashes with TypeError: step() got an unexpected keyword argument 'eta' #170

Closed

Description

Describe the bug

When attempting text-to-image synthesis, Stable Diffusion v1-3 crashes with TypeError: step() got an unexpected keyword argument 'eta'

EDIT: I didn't realize someone started a thread about this same bug in the Community tab of the model's HuggingFace page, though there's no discussion there yet. Sorry if this shouldn't have been opened, please let me know if I should close this, thanks.

Reproduction

!pip install git+https://github.com/huggingface/diffusers.git
!pip install transformers

import torch
from diffusers import LDMTextToImagePipeline

access_token = # insert access token here

pipe = LDMTextToImagePipeline.from_pretrained("CompVis/stable-diffusion-v1-3-diffusers", use_auth_token=access_token)

prompt  = "19th Century wooden engraving of Elon musk" # or any other prompt

seed = torch.manual_seed(1024)
images = pipe([prompt], num_inference_steps=50, guidance_scale=7.5, generator=seed)["sample"]

# save images
for idx, image in enumerate(images):
    image.save(f"image-{idx}.png")

Logs

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-a43d8871a546> in <module>()
      7 
      8 seed = torch.manual_seed(1024)
----> 9 images = pipe([prompt], num_inference_steps=50, guidance_scale=7.5, generator=seed)["sample"]
     10 
     11 # save images

1 frames
/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     25         def decorate_context(*args, **kwargs):
     26             with self.clone():
---> 27                 return func(*args, **kwargs)
     28         return cast(F, decorate_context)
     29 

/usr/local/lib/python3.7/dist-packages/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py in __call__(self, prompt, batch_size, generator, torch_device, eta, guidance_scale, num_inference_steps, output_type)
     87 
     88             # compute the previous noisy sample x_t -> x_t-1
---> 89             latents = self.scheduler.step(noise_pred, t, latents, **extra_kwrags)["prev_sample"]
     90 
     91         # scale and decode the image latents with vae

TypeError: step() got an unexpected keyword argument 'eta'

System Info

diffusers 0.1.3
transformers 4.21.1
Python 3.7.13

Activity

  1. ghost added
    bugSomething isn't working
    on Aug 13, 2022
  2. patil-suraj commented on Aug 13, 2022

    @patil-suraj
    Contributor

    Thanks for reporting, updating main should fix this this.

    pip install -U git+https://github.com/huggingface/diffusers.git

  3. wyf0912 commented on Dec 13, 2022

    @wyf0912

    I meet the same problem when running the following code given by the official repo of DDIM

    from diffusers import DDIMPipeline
    
    model_id = "google/ddpm-cifar10-32"
    
    # load model and scheduler
    ddim = DDIMPipeline.from_pretrained(model_id)
    
    # run pipeline in inference (sample random noise and denoise)
    image = ddim(num_inference_steps=50).images[0]
    
    # save image
    image.save("ddim_generated_image.png")
  4. patrickvonplaten commented on Dec 16, 2022

    @patrickvonplaten
    Contributor

    @wyf0912 could you please try upgraded your diffusers version: pip install --upgrade diffusers and try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions