Arcaryx / ComfyKritaSync

MIT License
1 stars 0 forks source link

Send only specific selections #1

Open wilzamguerrero opened 1 week ago

wilzamguerrero commented 1 week ago

Thank you very much, just what we needed to have our own workflows, but is there a way to send only the layer selection to Confyui and not the entire document area, so I could send only specific selections?

Arcaryx commented 5 days ago

I could be misunderstanding your use case here, but if you REALLY wanted to only send a selection you could create a group containing your target layer below a transparency mask layer. After masking out your selection, pointing Get Image from Krita at that group would pull just the selection with transparency all around. This would give you an image containing your selection surrounded by black, and a mask representing your selection.

The easiest option for inpainting is just adding a new paint layer and grabbing the mask output (invert if necessary, depending on if you painted or erased on the layer).

Arcaryx commented 5 days ago

Re-reading this, I think I misunderstood.

If the goal is to output just a selection (say 512x512 selection of one character when the full document is 1024x1024), the current implementation would output the full resolution (1024x1024).

I've been making use of Impact Pack's MaskDetailer to re-generate specific masked regions, which has been covering this use-case for my workflows. I feel as though this probably belongs as a separate node, one that takes an image+mask and outputs an image+mask, both cropped to either the minimum size, or centered and cropped to a minimum specified in a widget.