Stability-AI / StableCascade

Official Code for Stable Cascade
MIT License
6.44k stars 518 forks source link

Inpainting #19

Open MushroomFleet opened 4 months ago

MushroomFleet commented 4 months ago

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.

plaurent commented 4 months ago

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

Preethse commented 4 months ago

Is this issue solved?

StonecutterX commented 4 months ago

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

99991 commented 4 months ago

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.

xv5kVu4FN commented 3 months ago

Any updates regarding the inpainting example?

99991 commented 3 months ago

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