We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c92360 commit 2da4741Copy full SHA for 2da4741
examples/text_to_image/pipeline_stable_diffusion_img2img_render_text.py
@@ -206,11 +206,18 @@ def __call__(
206
)
207
# 6.1 Prepare latent variables
208
num_channels_latents = self.unet.in_channels // 2
209
+
210
+ # copied from https://github.com/huggingface/diffusers/blob/main/examples/community/img2img_inpainting.py
211
+ if isinstance(image, PIL.Image.Image):
212
+ w, h = image.size
213
+ elif isinstance(image, torch.Tensor):
214
+ *_, h, w = image.shape
215
216
latents = self.prepare_latents(
217
batch_size * num_images_per_prompt,
218
num_channels_latents,
- image.shape[2],
- image.shape[1],
219
+ h,
220
+ w,
221
text_embeddings.dtype,
222
device,
223
generator,
0 commit comments