comfyui-inpaint-nodes icon indicating copy to clipboard operation
comfyui-inpaint-nodes copied to clipboard

Inpaint with Fooocus, request sdxl model every time at KSampler. Cost extra time

Open jarheadjoe opened this issue 1 year ago • 4 comments

jarheadjoe avatar Jun 27 '24 05:06 jarheadjoe

It doesn't, unless you change the inputs like image/mask.

Acly avatar Jun 27 '24 08:06 Acly

It doesn't, unless you change the inputs like image/mask.

Yes, when change input image, it requests to load new model. But in normal i2i or inpaint workflow, changing inputs will not request new model. I think the problem is in applyFoocusInpaint node: when changing input image, the node calculate the image feature and add to the model directly and return the new model, which makes comfyui think it should load a new model. I think the node ought to split to AssembleFoocusModel Node where it adds patch block to base model and ApplyFoocusInpaint Node where it feeds image and mask to the new model.

jarheadjoe avatar Jun 28 '24 02:06 jarheadjoe

Feeding the image/mask to the new model also changes the model. Attaching the image/mask to the model is the source of the problem, it would make more sense if they were passed in while sampling. I don't see a way to implement it that way without changes in base ComfyUI though, as it doesn't pass the latent to the patch function.

Acly avatar Jun 28 '24 10:06 Acly

Maybe write a custom load node to load patch() and lora() as model and add it to base model to become a inpaint model

jarheadjoe avatar Jul 23 '24 06:07 jarheadjoe