lquesada / ComfyUI-Inpaint-CropAndStitch

ComfyUI nodes to crop before sampling and stitch back after sampling that speed up inpainting
GNU General Public License v3.0
398 stars 23 forks source link

Old node #9

Closed tombearx closed 6 months ago

tombearx commented 6 months ago

Is there any way to return old node where your inpaint area depends on resolution? This way you don't need to manually control inpainting area based on the inpainting scenario.

lquesada commented 6 months ago

hi,

I don't quite understand what you mean. What is your use case? The node offers two behaviors: mode "forced size" and mode "free size". Try switching from one to the other, because that's what you may want.

tombearx commented 6 months ago

hi,

I don't quite understand what you mean. What is your use case? The node offers two behaviors: mode "forced size" and mode "free size". Try switching from one to the other, because that's what you may want.

Mostly current node is good for a high resolution inpaint area. I have a problem with small resolution pictures. For example, I want to inpaint eyes in mid shot picture of a person. To get enough context, right now I have to adjust a inpaint area manually using "context_expand_factor" or just by adding small dots to inpaint mask. Before it was possible just to set minimal resolution and inpaint area would be adjusted automatically.

For those cases the old node was great solution. Is it possible to return it as a separate node?

lquesada commented 6 months ago

ah, I get it.

I decommisioned that feature because it didn't yield high quality results and it was wasting a lot of processing.

What I'd recommend is to set the context_expand_factor for the context and set "forced size" mode to ensure a maximum resolution. From my tests, this is yielding better inpainting that the previous approach.

tombearx commented 6 months ago

ah, I get it.

I decommisioned that feature because it didn't yield high quality results and it was wasting a lot of processing.

What I'd recommend is to set the context_expand_factor for the context and set "forced size" mode to ensure a maximum resolution. From my tests, this is yielding better inpainting that the previous approach.

That's basically the problem, right now you have to manually choose context_expand_factor. Only then you can choose quality/resolution:

So, if you want to leave quality the same, previous node is more convenient. If you want to increase quality, current node is better. Both nodes are valuable in a different scenarios, as I see it.

lquesada commented 6 months ago

Hi,

Yes, I understand. In your case, context_expand_factor is the best solution. Again, the feature you're asking for was removed because it would likely case confusion and bad quality results.

For what it's worth, for extremely small areas, the result won't be great and it's better to upscale, generate, then downscale back. If you use a good inpainting model it will take care of keeping a quality similar to the rest of the picture.

Alternatively, just set whatever context_expand_factor or pixels and you don't have to tweak it manually a lot if you're editing only small areas.

Sorry about this :)