# Stable diffusion bs\>1 uses negative as prompt

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [October 8, 2022, 4:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130 "2022-10-08T04:09:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![crumb](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/crumb/32/11978_2.png) [@crumb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcrumb)%5C
**Post date:** [October 8, 2022, 4:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130%2F1 "2022-10-08T04:09:56Z")

</div>

Using negative prompts with a batch size \> 1 ([prompt]\*x , [negative]\*x in their respective ways) causes the image to be more towards the negative prompt than the normal prompt.

```auto
pipe([prompt]*x, negative_prompt=[negative]*x, width=width, height=height, guidance_scale=guidance_scale, num_inference_steps=steps)

```

I can link the notebook I’m using if necessary but the code here is so simple that I feel like I don’t need to.  
(seed 23335, w/h = 512, prompt = “frog”, negative = “bird”, x = 2, guidance\_scale = 7.5, steps = 150, using the `lms = LMSDiscreteScheduler( beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear" )`)

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/0/06c002ea306fb5bcafd4264d610d8d7cb4f26a00.jpeg)

This might fit better as an issue on the diffusers github but I really don’t know how to use that feature.

that first is using waifu-diffusion v1.3 converting with the conversion script in the repo, but it works the same with the normal stable diffusion v1-4 model too: (linked image so that the “1 embed per new user” thing doesn’t yell at me) [https://media.discordapp.net/attachments/1024588665596411944/1028159556561420318/unknown.png?width=1258&height=557](https://media.discordapp.net/attachments/1024588665596411944/1028159556561420318/unknown.png?width=1258&height=557)

edit: this is fixed by passing both as a single string, not using x or using it as a list, but passing “num\_images\_per\_prompt=x” when calling it, leaving this here in case other people find the same problem (same settings just using num\_images\_per\_prompt=2 instead of making the prompt a list and multiplying by 2: [https://media.discordapp.net/attachments/1024588665596411944/1028162978689847396/unknown.png](https://media.discordapp.net/attachments/1024588665596411944/1028162978689847396/unknown.png) )

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpcuenq)%5C
**Post date:** [October 8, 2022, 11:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130%2F2 "2022-10-08T11:41:30Z")

</div>

> [@crumb](#):
>
> edit: this is fixed by passing both as a single string, not using x or using it as a list, but passing “num\_images\_per\_prompt=x” when calling it

I was going to suggest that, glad you found it.

However, the previous method should also work, I’ll take a look and report back.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpcuenq)%5C
**Post date:** [October 8, 2022, 12:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130%2F3 "2022-10-08T12:02:17Z")

</div>

Hi @crumb,

I was able to reproduce the problem and opened [this issue](https://github.com/huggingface/diffusers/issues/779) in `diffusers` to track and fix it.

Thanks a lot for reaching out!

---

<div class="post-metadata">

**Author:** ![crumb](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/crumb/32/11978_2.png) [@crumb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcrumb)%5C
**Post date:** [October 8, 2022, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fstable-diffusion-bs-1-uses-negative-as-prompt%2F24130%2F4 "2022-10-08T12:05:56Z")

</div>

I think this line might have something to do with it?

> <https://github.com/huggingface/diffusers/blob/f3983d16eed57e46742d217363d8913bef7f748d/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L260>

uncond embeddings will already be a list (the negative prompts) so repeating them again won’t help, then in the line after where it’s putting the negatives with the positives, the model is only seeing the negatives (for both the uncond and cond input). Could be wrong but with a quick glance that’s what I think’s happening.

edit: oops you already said something like this in the issue, cheers!
