StableCascade icon indicating copy to clipboard operation
StableCascade copied to clipboard

Inpainting

Open MushroomFleet opened this issue 1 year ago • 6 comments

at this section in the example notebook:

`batch_size = 4 url = "https://cdn.discordapp.com/attachments/1121232062708457508/1204787053892603914/cat_dog.png?ex=65d60061&is=65c38b61&hm=37c3d179a39b1eca4b8894e3c239930cedcbb965da00ae2209cca45f883f86f4&" images = resize_image(download_image(url)).unsqueeze(0).expand(batch_size, -1, -1, -1)

batch = {'images': images}

mask = None

mask = torch.ones(batch_size, 1, images.size(2), images.size(3)).bool()

outpaint = False threshold = 0.2

with torch.no_grad(), torch.cuda.amp.autocast(dtype=torch.bfloat16): cnet, cnet_input = core.get_cnet(batch, models, extras, mask=mask, outpaint=outpaint, threshold=threshold) cnet_uncond = cnet

show_images(batch['images']) show_images(cnet_input)`

i received this error: `--------------------------------------------------------------------------- TypeError Traceback (most recent call last) in <cell line: 13>() 12 13 with torch.no_grad(), torch.cuda.amp.autocast(dtype=torch.bfloat16): ---> 14 cnet, cnet_input = core.get_cnet(batch, models, extras, mask=mask, outpaint=outpaint, threshold=threshold) 15 cnet_uncond = cnet 16

/content/StableCascade/train/train_c_controlnet.py in get_cnet(self, batch, models, extras, cnet_input, **kwargs) 141 with torch.no_grad(): 142 if cnet_input is None: --> 143 cnet_input = extras.controlnet_filter(images, **kwargs) 144 if isinstance(cnet_input, tuple): 145 cnet_input, cnet_input_preview = cnet_input

TypeError: SREffnetFilter.call() got an unexpected keyword argument 'mask'`

and am unable to generate the masks for the next steps. how should i fix this?

thanks for providing the notebooks, my text2image/image2image colab version runs great. I'm trying to build out the remaining features.

MushroomFleet avatar Feb 14 '24 07:02 MushroomFleet

The inpainting controlnet example seems incomplete as it doesn’t actually inpaint. Maybe some code is missing there.

plaurent avatar Feb 14 '24 14:02 plaurent

Is this issue solved?

Preethse avatar Feb 21 '24 04:02 Preethse

I did some experiments, and it seems that inpainting still not works well..

StonecutterX avatar Feb 22 '24 02:02 StonecutterX

~~In the meantime, the url https://cdn.discordapp.com/attachments/1121232062708457508/1204787053892603914/cat_dog.png?ex=65d60061&is=65c38b61&hm=37c3d179a39b1eca4b8894e3c239930cedcbb965da00ae2209cca45f883f86f4& expired.~~

~~Is there a reason why the example image is not stored in the GitHub repository as well?~~ EDIT: Probably not. Here is a pull request to fix the missing images: https://github.com/Stability-AI/StableCascade/pull/107

Note that this only fixes the missing images. The controlnet example is otherwise still broken.

99991 avatar Feb 29 '24 08:02 99991

Any updates regarding the inpainting example?

xv5kVu4FN avatar Apr 04 '24 09:04 xv5kVu4FN

There have been no updates in the last two months unfortunately. The authors are busy with other things.

99991 avatar Apr 04 '24 09:04 99991