NimaNzrii / comfyui-photoshop

ComfyUi inside of your Photoshop! you can install the plugin and enjoy free ai genration
Other
494 stars 27 forks source link

Inpainting low resolution #133

Open therysin opened 2 months ago

therysin commented 2 months ago

Is there any way to make inpainting blend better? For most images you can see how low the resolution is when inpainting. If I manually inpaint using a custom workflow in comfyui I don't get this issue.

Also there seems to be an issue when trying to edit high resolution images with this plugin. Large images are not sent to the plugin at all. For example, I'm using a 12MP photo, which can work fine with comfyui, but is not even sent to the plugin from photoshop.

Thank you for working on this amazing plugin. Greatly appreciate it.

Theliel commented 1 month ago

Exactly the same problem.

Inpainting works relatively well, but it is not usable, the image it brings back has an extremely low resolution, which means that any inpainting is very meaningless. I tried to play with the current flow to see if it was possible to solve it, but as saied, full image are generated to 1024*768...

Thank in advanced

Theliel commented 1 month ago

Edit:

Ok, I know what its the problem.

You must Rise "DownScale if Bigger" options to accommodate the resolution of your image, or full image (not only masked) is downscaled to 1024. The problem seem to be the flow, because in really not only the masked part is being generated, but rather a complete image is being generated, and only the masked part is inserted into PS. So, if you open an image of say 4000x4000, and raise the value to 4000 for "DownScale if Bigger", ComfyUI has to generate a full 4000x4000 image, which obviously takes forever, and only for extract the masked area.

The proper flow is for ComFyUI to load the entire image passed by PS, the mask of course, and generate only the masked part, so that the content returned to PS is just that part, not the full image.

therysin commented 1 month ago

Edit:

Ok, I know what its the problem.

You must Rise "DownScale if Bigger" options to accommodate the resolution of your image, or full image (not only masked) is downscaled to 1024. The problem seem to be the flow, because in really not only the masked part is being generated, but rather a complete image is being generated, and only the masked part is inserted into PS. So, if you open an image of say 4000x4000, and raise the value to 4000 for "DownScale if Bigger", ComfyUI has to generate a full 4000x4000 image, which obviously takes forever, and only for extract the masked area.

The proper flow is for ComFyUI to load the entire image passed by PS, the mask of course, and generate only the masked part, so that the content returned to PS is just that part, not the full image.

Funnily enough, I realized the problem was that workflow for inpainting was generating the entire image. I replaced the workflow with one I made using https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch and the results still came out blurry lmao. Will try the downscale if bigger stuff sometime.

Theliel commented 1 month ago

Hello therysin

Yes, after fighting yesterday with it for a while, I opted for exactly the same solution, I slightly modified the workflow with the two nodes (crop and Stitch), and the result is quite good, I still have to adjust some parameters, but I finally have a realistic and simple (and works better) solution integrated into PS

KINGLIFER commented 1 month ago

Is there a reason no one is sharing a workflow to the rest of us?