Unverified Commit f3fac68c authored by Michael Gartsbein's avatar Michael Gartsbein Committed by GitHub
Browse files

small bugfix at StableDiffusionDepth2ImgPipeline call to check_inputs and...


small bugfix at StableDiffusionDepth2ImgPipeline call to check_inputs and batch size calculation (#2423)

small bugfix in call to check_inputs and batch size calculation
Co-authored-by: default avatarmishka <gartsocial@gmail.com>
parent 8f1fe75b
......@@ -587,13 +587,26 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
# 1. Check inputs
self.check_inputs(prompt, strength, callback_steps)
self.check_inputs(
prompt,
strength,
callback_steps,
negative_prompt=negative_prompt,
prompt_embeds=prompt_embeds,
negative_prompt_embeds=negative_prompt_embeds,
)
if image is None:
raise ValueError("`image` input cannot be undefined.")
# 2. Define call parameters
batch_size = 1 if isinstance(prompt, str) else len(prompt)
if prompt is not None and isinstance(prompt, str):
batch_size = 1
elif prompt is not None and isinstance(prompt, list):
batch_size = len(prompt)
else:
batch_size = prompt_embeds.shape[0]
device = self._execution_device
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
# of the Imagen paper: https://arxiv.org/pdf/2205.11487.pdf . `guidance_scale = 1`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment