ComfyUI-Custom-Scripts icon indicating copy to clipboard operation
ComfyUI-Custom-Scripts copied to clipboard

Collaborate with me to make things work better with Use Everywhere?

Open chrisgoringe opened this issue 2 years ago • 1 comments

Hi - author of the https://github.com/chrisgoringe/cg-use-everywhere Use Everywhere nodes here.

Wondering if you'd be open to working with me to make our two systems work more smoothly together?

An example: at the moment the Preset Text node and the UE nodes are incompatible because the way Preset Text pushes values into widgets and the way UE creates links don't know about each other.

I was wondering if you'd consider checking for the existence of a method on outNode (which doesn't exist yet - but I could add to the UE nodes) which returned a list of (outNode, outIn) pairs enumerating the inputs that UE is sending data to?

This would be a small change to presetText.js, around line 150 - something like:

	const outNode = app.graph.getNodeById(link_info.target_id);
        var outInPairs;
        if (outNode.broadcastsDataTo) outInPairs = outNode.broadcastsDataTo(link_info.target_slot);
        else outInPairs = [ [outNode, outNode && outNode.inputs && outNode.inputs[link_info.target_slot] ]];
	outInPairs.forEach((oi) => {
		if (oi[1].widget) {
			const w = oi[0].widgets.find((w) => w.name === oi[1].widget.name);
			   ...
                           ...
                        w.value = preset.value;
                }
	}

I could do a PR on your code, but you might well prefer to have some input into how this is best done.

chrisgoringe avatar Mar 18 '24 21:03 chrisgoringe

Sure, happy to accept a PR

pythongosssss avatar Mar 23 '24 17:03 pythongosssss