# String Format Error in Stable Diffusion Pipeline

**URL:** <https://discuss.huggingface.co/t/string-format-error-in-stable-diffusion-pipeline/49935>\
**Category:** 🧨 Diffusers\
**Created:** [August 8, 2023, 9:09am UTC](https://discuss.huggingface.co/t/string-format-error-in-stable-diffusion-pipeline/49935 "2023-08-08T09:09:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ifeanyi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ifeanyi/32/16066_2.png) [@Ifeanyi](https://discuss.huggingface.co/u/Ifeanyi)\
**Post date:** [August 8, 2023, 9:09am UTC](https://discuss.huggingface.co/t/string-format-error-in-stable-diffusion-pipeline/49935/1 "2023-08-08T09:09:10Z")

</div>

I am trying to add negative prompt and other parameters to my StableDiffusionPipeline.from\_pretrained() pipeline. Here is my code:

```auto
from diffusers import StableDiffusionPipeline
import torch

def imagineArt(prompt,negative_prompt,guidance_scale,num_images_per_prompt,height,width):
  model_id = "dreamlike-art/dreamlike-photoreal-2.0"
  pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
  pipe = pipe.to("cuda")

  prompt = str(prompt)
  negative_prompt = str(negative_prompt)
  guidance_scale = float(guidance_scale)
  num_images_per_prompt = int(num_images_per_prompt)

  image = pipe(prompt,negative_prompt,guidance_scale,num_images_per_prompt,height,width).images[0]
  return image

imagineArt(prompt = "Young woman wearing a leather jacket, looking at the camera, background lighting at night, close up camera shot, photoreal, hyperrealistic, 8k",
           negative_prompt="ugly,digital,blender,cartoonish,painting,disproportionate",
           guidance_scale=7.5,
           num_images_per_prompt=2)`

```

When I run the code, I get the error message below:

```auto
TypeError Traceback (most recent call last)
<ipython-input-67-4073f1768ab7> in <cell line: 1>()
----> 1 imagineArt(prompt = "Young woman wearing a leather jacket, looking at the camera, background lighting at night, close up camera shot, photoreal, hyperrealistic, 8k",
      2 negative_prompt="ugly,digital,blender,cartoonish,painting,disproportionate",
      3 guidance_scale=7.5,
      4 num_images_per_prompt=2)

3 frames
/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py in check_inputs(self, prompt, height, width, callback_steps, negative_prompt, prompt_embeds, negative_prompt_embeds)
    459 negative_prompt_embeds=None,
    460 ):
--> 461 if height % 8 != 0 or width % 8 != 0:
    462 raise ValueError(f"`height` and `width` have to be divisible by 8 but are {height} and {width}.")
    463 

TypeError: not all arguments converted during string formatting

```

What can I do differently please? Thanks for your anticipated help!
