Stability-AI / StableSwarmUI

StableSwarmUI, A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
MIT License
4.59k stars 368 forks source link

how to do controlnet reference? #368

Closed FemBoxbrawl closed 5 months ago

FemBoxbrawl commented 5 months ago

I don't know how to do reference_only or something like that, is there a way to implement it if not done already?

mcmonkey4eva commented 5 months ago

"controlnet reference" isn't actually a controlnet, it's just merged into that extension for auto webui --- to use in swarm you'd need to find a Comfy node for it, which last i looked iirc there's only experimental/hacky ones not great options. See also earlier thread here https://github.com/Stability-AI/StableSwarmUI/issues/176

Sisimshow commented 5 months ago

I too would be interested in this. It does work for Stability Matrix Inference interface (which uses ComfyUI) so it can be done. The results aren't the same as using Revision or IPAdapter, I'd say for replicating, say, the outfit of a character without a Lora, it's much better. This is one of the last things keeping me from jumping from A1111/Forge to StableSwarm because I use it for making variants of my D&D character art.

All that said, I don't want to sound overly assertive, just wanted to put out there that there is some demand for this feature and it's not simply an outdated version of Revision or IPadapter.

mcmonkey4eva commented 5 months ago

It does work for Stability Matrix Inference interface (which uses ComfyUI) so it can be done do you have a reference to the comfy node they used for it?

Sisimshow commented 5 months ago

Yes, Inference_Core_ReferenceOnlySimple. Here is a picture made with Stability Matrix using Reference Only and put into ComfyUI. workflow.json 2024-06-03_21-42-06-AutismMixSDXLPony-1322834208

Sisimshow commented 5 months ago

Sorry for the anime

mcmonkey4eva commented 5 months ago

Inference_Core_ReferenceOnlySimple appears to correspond to https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes/blob/main/src/inference_core_nodes/comfyui_experiments/reference_only.py which is Inference's wonky broken import of https://github.com/comfyanonymous/ComfyUI_experiments/blob/master/reference_only.py which as noted in the prior thread didn't seem to generally actually work as intended last I tested it

I guess I'll have to re-test

Sisimshow commented 5 months ago

I appreciate the effort :) I hope this doesn't waste too much of your time good man

Edit

It at least seems to work similarly to how it does in Forge using the ControlNet extension, though I can't get an exact 1 to 1 output, just very similar.

mcmonkey4eva commented 5 months ago

I'm very confused what happened last year when trying it then, but it indeed works now!

I've enabled ReferenceOnly via comfy's experiment code (slightly adapted), with a new Use Reference Only param under ReVision (ie drag an image to prompt box and it will be included as an option) image

Sisimshow commented 5 months ago

Niceness! Thank you so much!