Skip to content

Pull request #793 broke negative prompts for IMG2IMG pipeline #820

@OrionFive

Description

@OrionFive

Describe the bug

The commit #793 broke negative prompts. By changing the type of prompt before changing the type of negPrompt, but comparing their types in between, it is now impossible to use single negative prompts.

Would be great if you could resolve this, @patrickvonplaten.

Reproduction

Use a single str negative prompt with the img2img pipeline.

Logs

/content/diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py in __call__(self, prompt, init_image, strength, num_inference_steps, guidance_scale, negative_prompt, num_images_per_prompt, eta, generator, output_type, return_dict, callback, callback_steps, **kwargs)
    251             elif type(prompt) is not type(negative_prompt):
    252                 raise TypeError(
--> 253                     "`negative_prompt` should be the same type to `prompt`, but got {type(negative_prompt)} !="
    254                     " {type(prompt)}."
    255                 )

TypeError: `negative_prompt` should be the same type to `prompt`, but got {type(negative_prompt)} != {type(prompt)}.

System Info

Latest version from GitHub main branch.

Metadata

Metadata

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