Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inpainting #19

Open
MushroomFleet opened this issue Feb 14, 2024 · 6 comments
Open

Inpainting #19

MushroomFleet opened this issue Feb 14, 2024 · 6 comments

Comments

@MushroomFleet
Copy link

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
Copy link

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

@Preethse
Copy link

Is this issue solved?

@StonecutterX
Copy link

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

@99991
Copy link

99991 commented Feb 29, 2024

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: #107

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

@xv5kVu4FN
Copy link

Any updates regarding the inpainting example?

@99991
Copy link

99991 commented Apr 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants