Is it possible to do inpainting without any control image?

#12
by arnkmish - opened

Is it possible to do inpainting without any control image?

I tried to generate using only the inpaint_image and inpaint_mask as input:

import PIL

image = pipe(
prompt="A white friendly robotic dog sitting on a bench",
inpaint_image=inpaint_image,
inpaint_mask=inpaint_mask,
# control_image=control_image,
# control_strength=0.5,
# control_stop=0.33,
height=1024,
width=1024,
guidance_scale=3.5,
num_inference_steps=50,
generator=torch.Generator("cpu").manual_seed(42)
).images[0]

But got the following error:

File ~/.cache/huggingface/modules/diffusers_modules/local/pipeline.py:294, in Flex2Pipeline.call(self, prompt, prompt_2, inpaint_image, inpaint_mask, control_image, control_strength, control_stop, height, width, num_inference_steps, sigmas, guidance_scale, num_images_per_prompt, generator, latents, prompt_embeds, pooled_prompt_embeds, output_type, return_dict, joint_attention_kwargs, callback_on_step_end, callback_on_step_end_tensor_inputs, max_sequence_length, **kwargs)
292 inpaint_image = self.vae.encode(inpaint_image).latent_dist.sample(generator=generator)
293 inpaint_latents = (inpaint_image - self.vae.config.shift_factor) * self.vae.config.scaling_factor
--> 294 height_inpaint_image, width_inpaint_image = control_image.shape[2:]
296 inpaint_mask = self.prepare_image(
297 image=inpaint_mask,
298 width=width,
(...)
303 dtype=self.vae.dtype,
304 )
305 # mask is 3 ch -1 to 1. make it 1ch, 0 to 1

AttributeError: 'NoneType' object has no attribute 'shape'

Sign up or log in to comment