Acly / krita-ai-diffusion

Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required.
https://www.interstice.cloud
GNU General Public License v3.0
6.3k stars 301 forks source link

Allow option to enable a save node in workflow sent to ComfyUI #946

Closed sraney closed 1 week ago

sraney commented 1 month ago

Would It be possible to add an option to enable mirroring results sent to the "Send Image (WebSocket)" node and pipe it to an additional "Save Image" node?

I hacked a forced node in the ai_diffusion/workflow.py but, that's a mess but works.

Example workflow generated by my hack. ( moved the node to make it a bit more presentable.

Krita-ComfyUILocalSave

Acly commented 1 month ago

Yes but why? Images are already saved in the document, and doing it this way will give partial / incomplete images for selections.

sraney commented 1 month ago

Yes but why? Images are already saved in the document, and doing it this way will give partial/incomplete images for selections.

Due to how ComfyUI saves the workflow and allows me to rebuild it with a drag and drop back into ComfyUI to see the workflow created. Currently the 'save workflow' only seems to save the last workflow used. Also, it allows me to use them outside of Kriata if I need to rebuild or import them into Clip Studio Paint or Inkscape. Currently, there is no way to see what model was used. I often flip between models when moving between backgrounds and foreground subjects.

asn88 commented 1 month ago

+1 Sometimes there is a need to look at the workflow in history. For example, when experimenting with LoRA, to see the names and weights used. Alternatively, it would be nice to have a menu item for saving the workflow. Something like: image

Acly commented 1 month ago

Problem is it requires to keep all workflows ever created. Unlike most ComfyUI workflows, the plugin's workflow always contain the entire data (all input images full resolution lossless). It eats up lot of memory really fast, for something most people will never access, and even those that do only rarely.

asn88 commented 1 month ago

I agree, this will really increase memory consumption. Thanks for taking the time to review my idea.