Giter VIP home page Giter VIP logo

rgthree-comfy's Introduction

rgthree-comfy
Making ComfyUI more comfortable!

The Nodes   |   Improvements & Features   |   Link Fixer


A collection of nodes and improvements created while messing around with ComfyUI. I made them for myself to make my workflow cleaner, easier, and faster. You're welcome to try them out. But remember, I made them for my own use cases :)

Context Node

Get Started

Install

  1. Install the great ComfyUi.
  2. Clone this repo into custom_modules:
    cd ComfyUI/custom_nodes
    git clone https://github.com/rgthree/rgthree-comfy.git
    
  3. Start up ComfyUI.

Settings

You can configure certain aspect of rgthree-comfy. For instance, perhaps a future ComfyUI change breaks rgthree-comfy, or you already have another extension that does something similar and you want to turn it off for rgthree-comfy.

You can get to rgthree-settings by right-clicking on the empty part of the graph, and selecting rgthree-comfy > Settings (rgthree-comfy) or by clicking the rgthree-comfy settings in the ComfyUI settings dialog.

(Note, settings are stored in an rgthree_config.json in the rgthree-comfy directory. There are other advanced settings that can only be configured there; You can copy default settings from rgthree_config.json.default before rgthree_config.json before modifying).


✴️ The Nodes

Note, you can right-click on a bunch of the rgthree-comfy nodes and select 🛟 Node Help menu item for in-app help when available.

Seed

An intuitive seed control node for ComfyUI that works very much like Automatic1111's seed control.

ℹ️ See More Information
  • Set the seed value to "-1" to use a random seed every time
  • Set any other number in there to use as a static/fixed seed
  • Quick actions to randomize, or (re-)use the last queued seed.
  • Images metadata will store the seed value (so dragging an image in, will have the seed field already fixed to its seed).
  • Secret Features: You can manually set the seed value to "-2" or "-3" to increment or decrement the last seed value. If there was not last seed value, it will randomly use on first.

Router Node

Reroute

Keep your workflow neat with this much improved Reroute node with, like, actual rerouting with multiple directions and sizes.

ℹ️ More Information
  • Use the right-click context menu to change the width, height and connection layout
  • Also toggle resizability (min size is 40x43 if resizing though), and title/type display.

Router Node

Bookmark (🔖)

Place the bookmark node anywhere on screen to quickly navigate to that with a shortcut key.

ℹ️ See More Information
  • Define the shortcut_key to press to go right to that bookmark node, anchored in the top left.
  • You can also define the zoom level as well!
  • Pro tip: shortcut_key can be multiple keys. For instance "alt + shift + !" would require pressing the alt key, the shift key, and the "!" (as in the "1" key, but with shift pressed) in order to trigger.

Context / Context Big

Pass along in general flow properties, and merge in new data. Similar to some other node suites "pipes" but easier merging, is more easily interoperable with standard nodes by both combining and exploding all in a single node.

ℹ️ More Information
  • Context and Context Big are backwards compatible with each other. That is, an input connected to a Context Big will be passed through the CONTEXT outputs through normal Context nodes and available as an output on either (or, Context Big if the output is only on that node, like "steps").
  • Pro Tip: When dragging a Context output over a nother node, hold down "ctrl" and release to automatically connect the other Context outputs to the hovered node.
  • Pro Tip: You can change between Context and Context Big nodes from the menu.

Context Node

Image Comparer

The Image Comparer node compares two images on top of each other.

ℹ️ More Information
  • Note: The right-click menu may show image options (Open Image, Save Image, etc.) which will correspond to the first image (image_a) if clicked on the left-half of the node, or the second image if on the right half of the node.
  • Inputs:
    • image_a Required. The first image to use to compare. If image_b is not supplied and image_a is a batch, the comparer will use the first two images of image_a.
    • image_b Optional. The second image to use to compare. Optional only if image_a is a batch with two images.
  • Properties: You can change the following properties (by right-clicking on the node, and select "Properties" or "Properties Panel" from the menu):
    • comparer_mode - Choose between "Slide" and "Click". Defaults to "Slide".

Image Inset Crop

The node that lets you crop an input image by either pixel value, or percentage value.

Display Any

Displays most any piece of text data from the backend after execution.

Power Lora Loader

A super-simply Lora Loader node that can load multiple Loras at once, and quick toggle each, all in an ultra-condensed node.

ℹ️ More Information
  • Add as many Lora's as you would like by clicking the "+ Add Lora" button. There's no real limit!
  • Right-click on a Lora widget for special options to move the lora up or down (no affect on image, just presentation), toggle it on/off, or delete the row all together.
  • from the properties, change the Show Strengths to choose between showing a single, simple strength value (which will be used for both model and clip), or a more advanced view with both model and clip strengths being modifiable.

Lora Loader Stack

Deprecated. Used the Power Lora Loader instead.

A simplified Lora Loader stack. Much like other suites, but more interoperable with standard inputs/outputs.

Power Prompt

Power up your prompt and get drop downs for adding your embeddings, loras, and even have saved prompt snippets.

ℹ️ More Information
  • At the core, you can use Power Prompt almost as a String Primitive node with additional features of dropdowns for choosing your embeddings, and even loras, with no further processing. This will output just the raw TEXT to another node for any lora processing, CLIP Encoding, etc.
  • Connect a CLIP to the input to encode the text, with both the CLIP and CONDITIONING output right from the node.
  • Connect a MODEL to the input to parse and load any <lora:...> tags in the text automatically, without needing a separate Lora Loaders

Power Prompt - Simple

Same as Power Prompt above, but without LORA support; made for a slightly cleaner negative prompt (since negative prompts do not support loras).

SDXL Power Prompt - Positive

The SDXL sibling to the Power Prompt above. It contains the text_g and text_l as separate text inputs, as well a couple more input slots necessary to ensure proper clipe encoding. Combine with

SDXL Power Prompt - Simple

Like the non-SDXL Power Prompt - Simple node, this one is essentially the same as the SDXL Power Prompt but without lora support for either non-lora positive prompts or SDXL negative prompts (since negative prompts do not support loras).

SDXL Config

Just some configuration fields for SDXL prompting. Honestly, could be used for non SDXL too.

Context Switch / Context Switch Big

A powerful node to branch your workflow. Works by choosing the first Context input that is not null/empty.

ℹ️ More Information
  • Pass in several context nodes and the Context Switch will automatically choose the first non-null context to continue onward with.
  • Wondering how to toggle contexts to null? Use in conjuction with the Fast Muter or Fast Groups Muter

Any Switch

A powerful node to similar to the Context Switch above, that chooses the first input that is not null/empty.

ℹ️ More Information
  • Pass in several inmputs of the same type and the Any Switch will automatically choose the first non-null value to continue onward with.
  • Wondering how to toggle contexts to null? Use in conjuction with the Fast Muter or Fast Groups Muter

Fast Groups Muter

The Fast Groups Muter is an input-less node that automatically collects all groups in your current workflow and allows you to quickly mute and unmute all nodes within the group.

ℹ️ More Information
  • Groups will automatically be shown, though you can filter, sort and more from the node Properties (by right-clicking on the node, and select "Properties" or "Properties Panel" from the menu). Properties include:

  • matchColors - Only add groups that match the provided colors. Can be ComfyUI colors (red, pale_blue) or hex codes (#a4d399). Multiple can be added, comma delimited.

  • matchTitle - Filter the list of toggles by title match (string match, or regular expression).

  • showNav - Add / remove a quick navigation arrow to take you to the group. (default: true)

  • sort - Sort the toggles' order by "alphanumeric", graph "position", or "custom alphabet". (default: "position")

  • customSortAlphabet - When the sort property is "custom alphabet" you can define the alphabet to use here, which will match the beginning of each group name and sort against it. If group titles do not match any custom alphabet entry, then they will be put after groups that do, ordered alphanumerically.

    This can be a list of single characters, like "zyxw..." or comma delimited strings for more control, like "sdxl,pro,sd,n,p".

    Note, when two group title match the same custom alphabet entry, the normal alphanumeric alphabet breaks the tie. For instance, a custom alphabet of "e,s,d" will order groups names like "SDXL, SEGS, Detailer" eventhough the custom alphabet has an "e" before "d" (where one may expect "SE" to be before "SD").

    To have "SEGS" appear before "SDXL" you can use longer strings. For instance, the custom alphabet value of "se,s,f" would work here.

  • toggleRestriction - Optionally, attempt to restrict the number of widgets that can be enabled to a maximum of one, or always one.

    Note: If using "max one" or "always one" then this is only enforced when clicking a toggle on this node; if nodes within groups are changed outside of the initial toggle click, then these restriction will not be enforced, and could result in a state where more than one toggle is enabled. This could also happen if nodes are overlapped with multiple groups.

Fast Groups Bypasser

Same as Fast Groups Muter above, but sets the connected nodes to "Bypass" instead of "Mute"

Fast Muter

A powerful 'control panel' node to quickly toggle connected nodes allowing them to quickly be muted or enabled

ℹ️ More Information
  • Add a collection of all connected nodes allowing a single-spot as a "dashboard" to quickly enable and disable nodes. Two distinct nodes; one for "Muting" connected nodes, and one for "Bypassing" connected nodes.

Fast Bypasser

Same as Fast Muter but sets the connected nodes to "Bypass"

Fast Actions Button

Oh boy, this node allows you to semi-automate connected nodes and/or ConfyUI.

ℹ️ More Information
  • Connect nodes and, at the least, mute, bypass or enable them when the button is pressed.
  • Certain nodes expose additional actions. For instance, the Seed node you can set Randomize Each Time or Use Last Queued Seed when the button is pressed.
  • Also, from the node properties, set a shortcut key to toggle the button actions, without needing a click!

Node Collector

Used to cleanup noodles, this will accept any number of input nodes and passes it along to another node.

⚠️ Currently, this should really only be connected to Fast Muter, Fast Bypasser, or Mute / Bypass Relay.

Mute / Bypass Repeater

A powerful node that will dispatch its Mute/Bypass/Active mode to all connected input nodes or, if in a group w/o any connected inputs, will dispatch its Mute/Bypass/Active mode to all nodes in that group.

ℹ️ More Information
  • 💡 Pro Tip #1: Connect this node's output to a Fast Muter or Fast Bypasser to have a single toggle there that can mute/bypass/enable many nodes with one click.

  • 💡 Pro Tip #2: Connect a Mute / Bypass Relay node to this node's inputs to have the relay automatically dispatch a mute/bypass/enable change to the repeater.

Mute / Bypass Relay

An advanced node that, when working with a Mute / Bypass Repeater, will relay its input nodes' modes (Mute, Bypass, or Active) to a connected repeater (which would then repeat that mode change to all of its inputs).

ℹ️ More Information
  • When all connected input nodes are muted, the relay will set a connected repeater to mute (by default).
  • When all connected input nodes are bypassed, the relay will set a connected repeater to bypass (by default).
  • When any connected input nodes are active, the relay will set a connected repeater to active (by default).
  • Note: If no inputs are connected, the relay will set a connected repeater to its mode when its own mode is changed. Note, if any inputs are connected, then the above bullets will occur and the Relay's mode does not matter.
  • Pro Tip: You can change which signals get sent on the above in the Properties. For instance, you could configure an inverse relay which will send a MUTE when any of its inputs are active (instead of sending an ACTIVE signal), and send an ACTIVE signal when all of its inputs are muted (instead of sending a MUTE signal), etc.

Random Unmuter

An advanced node used to unmute one of its inputs randomly when the graph is queued (and, immediately mute it back).

ℹ️ More Information
  • Note: All input nodes MUST be muted to start; if not this node will not randomly unmute another. (This is powerful, as the generated image can be dragged in and the chosen input will already by unmuted and work w/o any further action.)
  • Tip: Connect a Repeater's output to this nodes input and place that Repeater on a group without any other inputs, and it will mute/unmute the entire group.

Label

A purely visual node, this allows you to add a floating label to your workflow.

ℹ️ More Information
  • The text shown is the "Title" of the node and you can adjust the the font size, font family, font color, text alignment as well as a background color, padding, and background border radius from the node's properties. You can double-click the node to open the properties panel.
  • Pro Tip #1: You can add multiline text from the properties panel (because ComfyUI let's you shift + enter there, only).
  • Pro Tip #2: You can use ComfyUI's native "pin" option in the right-click menu to make the label stick to the workflow and clicks to "go through". You can right-click at any time to unpin.
  • Pro Tip #3: Color values are hexidecimal strings, like "#FFFFFF" for white, or "#660000" for dark red. You can supply a 7th & 8th value (or 5th if using shorthand) to create a transluscent color. For instance, "#FFFFFF88" is semi-transparent white.

Advanced Techniques

First, a word on muting

A lot of the power of these nodes comes from Muting. Muting is the basis of correctly implementing multiple paths for a workflow utlizing the Context Switch node.

While other extensions may provide switches, they often get it wrong causing your workflow to do more work than is needed. While other switches may have a selector to choose which input to pass along, they don't stop the execution of the other inputs, which will result in wasted work. Instead, Context Switch works by choosing the first non-empty context to pass along and correctly Muting is one way to make a previous node empty, and causes no extra work to be done when set up correctly.

To understand muting, is to understand the graph flow

Muting, and therefore using Switches, can often confuse people at first because it feels like muting a node, or using a switch, should be able to stop or direct the forward flow of the graph. However, this is not the case and, in fact, the graph actually starts working backwards.

If you have a workflow that has a path like ... > Context > KSampler > VAE Decode > Save Image it may initially feel like you should be able to mute that first Context node and the graph would stop there when moving forward and skip the rest of that workflow.

But you'll quickly find that will cause an error, becase the graph doesn't actually move forward. When a workflow is processed, it first moves backwards starting at each "Output Node" (Preview Image, Save Image, even "Display String" etc.) and then walking backwards to all possible paths to get there.

So, with that ... > Context > KSampler > VAE Decode > Save Image example from above, we actually want to mute the Save Image node to stop this path. Once we do, since the output node is gone, none of these nodes will be run.

Let's take a look at an example.

A powerful combination: Using Context, Context Switch, & Fast Muter

Context Node

  1. Using the Context Switch (aqua colored in screenshot) feed context inputs in order of preference. In the workflow above, the Upscale Out context is first so, if that one is enabled, it will be chosen for the output. If not, the second input slot which comes from the context rerouted from above (before the Upscaler booth) will be chosen.

    • Notice the Upscale Preview is after the Upscale Out context node, using the image from it instead of the image from the upscale VAE Decoder. This is on purpose so, when we disable the Upscale Out context, none of the Upscaler nodes will run, saving precious GPU cycles. If we had the preview hooked up directly to the VAE Decoder the upscaler would always run to generate the preview, even if we had the Upscale Out context node disabled.
  2. We can now disable the Upscale Out context node by muting it. Highlighting it and pressing ctrl + m will work. By doing so, it's output will be None, and it will not pass anthing onto the further nodes. In the diagram you can see the Upscale Preview is red, but that's OK; there are no actual errors to stop execution.

  3. Now, let's hook it up to the Fast Muter node. The Fast Muter node works as dashboard by adding quick toggles for any connected node (ignoring reroutes). In the diagram, we have both the Upscaler Out context node, and the Save File context node hooked up. So, we can quickly enable and disable those.

    • The workflow seen here would be a common one where we can generate a handful of base previews cheaply with a random seed, and then choose one to upscale and save to disk.
  4. Lastly, and optionally, you can see the Node Collector. Use it to clean up noodles if you want and connect it to the muter. You can connect anything to it, but doing so may break your workflow's execution.


⚡ Improvements & Features

rgthree-comfy adds several improvements, features, and optimizations to ComfyUI that are not directly tied to nodes.

Progress Bar

A minimal progress bar that run alongs the top of the app window that shows the queue size, the current progress of the a prompt execution (within the same window), and the progress of multi-step nodes as well.

You can remove/enable from rgthree-comfy settings, as well as configure the height/size.

ComfyUI Recursive Optimization

An optimization to ComfyUI's recursive execution. Because rgthree-comfy nodes make it easy to build larger, more complex workflows, I (and others) started to hit a wall of poor execution times.

ℹ️ More Information
  • Until ComfyUI/issues/1502 is resolved and/or ComfyUI/pull/1503 is pulled in, then know that you're benefiting from hundreds of millions of saved cycles each run.

  • Specifically, for a rather complex test workflow, the patch reduces iterations of recursive_will_execute from 113,292,566 to just 135 (and 116.32 seconds to 69.84 seconds on my machine) on a fresh queue, and reduces recursive calls of recursive_output_delete_if_changed from 250,496,808 to 142 (and 158.13 seconds to 0.0 seconds on my machine).

  • ⚠️ However, there is a chance ComfyUI changes something in/around the code I patched which could break. If that's the case, you should disable the optimization from rgthree-comfy settings.

"Queue Selected Output Nodes" in right-click menu

Sometimes you want to just queue one or two paths to specific output node(s) without executing the entire workflow. Well, now you can do just that by right-clicking on an output node and selecting Queue Selected Output Nodes (rgthree).

ℹ️ More Information
  • Select the output nodes you want to execute.

  • Note: Only output nodes are captured and traversed, not all selected nodes. So if you select an output AND a node from a different path, only the path connected to the output will be executed and not non-output nodes, even if they were selected.

  • Note: The whole workflow is serialized, and then we trim what we don't want for the backend. So things like all seed random/increment/decrement will run even if that node isn't being sent in the end, etc.

Auto-Nest Subdirectories in long Combos

(Off by default while experimenting, turn on in rgthree-comfy settings).

Automatically detect top-level subdirectories in long combo lists (like, Load Checkpoint) and break out into sub directories.

Quick Mute/Bypass Toggles in Group Headers

(Off by default while experimenting, turn on in rgthree-comfy settings).

Adds a mute and/or bypass toggle icons in the top-right of Group Headers for one-click toggling of groups you may be currently looking at.

"Copy Image" in right-click menu

Right clicking on a node that has an image should have a context-menu item of "Copy Image" will allow you to copy the image right to your clipboard

🎓 I believe this has graduated, with ComfyUI recently adding this setting too. You won't get two menu items; my code checks that there isn't already a "Copy Image" item there before adding it.

Other/Smaller Fixes

  • Fixed the width of ultra-wide node chooser on double click.
  • Fixed z-indexes for textareas that would overlap above other elements, like Properties Panel, or @pythongosssss's image viewer.
  • Check for bad links when loading a workflow and log to console, by default. (See Link Fixer below).

📄 Link Fixer

If your workflows sometimes have missing connections, or even errors on load, start up ComfyUI and go to http://127.0.0.1:8188/rgthree/link_fixer which will allow you to drop in an image or workflow json file and check for and fix any bad links.

You can also enable a link fixer check in the rgthree-comfy settings to give you an alert if you load a workflow with bad linking data to start.

rgthree-comfy's People

Contributors

dotjack avatar drjkl avatar mcmonkey4eva avatar receyuki avatar rgthree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rgthree-comfy's Issues

'NoneType' object has no attribute 'movedim'

I am new to this so I don't understand what is the problem. Here is the error when I run stable diffusion:
image
I was trying to load a workflow but when I got everything that I needed for it to run correctly it didn't work:
image
What is the reason for this problem and how can I fix this?

add enhancement reroute

add the possibility to use resizing like in standard ComfyUI, by placing the cursor to the bottom right corner of the node and resize it by dragging and dropping.
and in your implementation there are no additional menus :
image
as well as a severe size limitation :
image

Thank you so much for your custom nodes

Default size reroute

Hello, Is it possible to choose a standard reroute size without changing the code?

bandicam.2023-10-01.14-50-11-527.mp4

At 23 seconds, you can notice a problem with the small reroute that I encounter

Reroute nodes keep disconnecting

For some reasons, two reroute nodes keep appearing disconnected whenever I refresh the browser or I reload my workflow. These two, and only these two:

Screenshot 2023-09-04 at 12 04 37

I even tried to delete them and recreate them, but the problem persists. Even more strangely, sometimes they remain connected upon refresh, and the CLIPTextEncodeSDXL node they connect to seems to be working fine even when they are disconnected.

Notice that this issue has existed for a long time, not just in the current version of the workflow. I just forgot to report it.

The JSON is here.

IMPORT FAILED?

Just downloaded your plugins for Comfy, I'm still new to comfy btw, and followed your instructions of the simple git pull but the import failed... here is what it shows in the console

Error:
[WinError 1314] A required privilege is not held by the client: 'F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyLiterals\js' -> 'F:\ComfyUI_windows_portable\ComfyUI\web\extensions\ComfyLiterals'
Failed to create symlink to F:\ComfyUI_windows_portable\ComfyUI\web\extensions\ComfyLiterals. Please copy the folder manually.
Source: F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyLiterals\js
Target: F:\ComfyUI_windows_portable\ComfyUI\web\extensions\ComfyLiterals

Loading: ComfyUI-Manager (V0.30.5)

ComfyUI Revision: 1487 [2381d36e] | Released on '2023-09-25'

INFO:comfyui-prompt-control:Use STYLE:weight_interpretation:normalization at the start of a prompt to use advanced encodings
INFO:comfyui-prompt-control:Weight interpretations available: comfy,A1111,compel,comfy++,down_weight,perp
INFO:comfyui-prompt-control:Normalization types available: none,mean,length,length+mean
Traceback (most recent call last):
File "F:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1725, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy_init
.py", line 92, in
rgthree_config_user = json.load(file)
File "json_init_.py", line 293, in load
File "json_init_.py", line 346, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Cannot import F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy module for custom nodes: Expecting value: line 1 column 1 (char 0)

it says to copy the ComfyLiterals folder Manually? but idk what it means by that tbh cuz all I did was git pull... do I just re-download that folder from the git hub and put it in there or...?

Node Disconnection from bypassers when used as a template (possible bug)

image

The left side works as expected, but when I save this as a template, many of the effects nodes become disconnected from the bypassers, requiring a manual re-attachment for the bypasser to work again. At first, I put all the connections into a node collector, but then thinking that might be the issue, I hooked them right into the bypass repeater itself, which are connected to a "disable all fx" switches at the top, and then I also hooked them up so each effect can be bypassed/enabled individually.

All my reroutes are rerouteprimitive/pyssss versus native, as I read that disconnections can happen with the regular reroute.

When saved as a workflow, all is well - no issues. Only difference is that in the upper left, there's a connection point for an image, whereas in the full 'workflow" version, there's an Input LoadImage (The template version is designed to be chained, hence the difference).

Attached is the JSON from the Template if that helps.
AegisFlow_MaskFX_Template.json

input files:
maskfx
swimsuit_watercolor
horizontal mask

Feature request: Context Big passing checkpoint name

Just like Context Big now passes sampler and scheduler name, it would be great if it could pass the checkpoint name, too, and separately from the model value. So I could address this unfortunate situation:

Screenshot 2023-09-16 at 23 10 47

In reality, that checkpoint name doesn't have to be transported any further than the Loader node right there, but, for the sake of having a separate control panel, it would be extremely useful.

Thank you

title reroutes node

Your 'reroute' node is great, but would it be possible to display the title?

Feature Request: Lora Loader Stack view info feature.

It'd be nice if you incorporated the original Lora Loader's View Info feature, that looks up the Lora's info on Civitai to glean trigger words.

You could have a sub menu;

  • View Info >
    • View Lora 01 Info
    • View Lora 02 Info
    • View Lora 03 Info
    • View Lora 04 Info

Popup Image for LoRAs (in LoRA Stacker)

Hey all,

I have a carp load of LoRAs and sometimes their function escapes me. I was hoping to add a hover-over option when navigating through them in the LoRA Stacker. Hoping I could get help with that (or if that's something RG3 wanted to tackle/add for everyone (=

I tried to figure this out myself, but I'm not an expert coder, no experience with Python...not sure how that plays into things, if at all. Had looked through the html, TS and js files. Particularly the Constants.x files – couldn't find any HTML/js specific to the LoRA Stacker.

Would just copy pasta some "Image Popup" code from the interweb but I couldn't find any specific code with regards to the LoRA Nav. Menu. Figured 1 could just throw in a .jpg with the name attached to the LoRA file to keep things organized/easy.

Thanks for any help! (And thanks for your amazing work RG3, you're a legend, even if your QB counterpart isn't lol)

Edit: Silly me, forgot to use inspect tool to investigate. See it is apart of LLL submenu sys., so hopefully now I can toy around with this!

Reroute node compatibility with Save Image w/ Metadata node (Comfy Image Saver suite)

Partially connected to #24 (the quest to transmit the checkpoint name over long distances), I'm encountering challenges in connecting a Checkpoint Selector node, from Comfy Image Saver suite, to their Save Image w/Metadata node, passing through your reroute node.

I opened an Issue with them:

giriss/comfy-image-saver#12

This is for visibility and documention only. I'll close it once it gets solved on the other side.

Action button collector

I have an idea: add a node that collects fast action button for centralized control of action.
It will highlight the most recently run action(Highlight the first action if no action has been run), like this

Screenshot 2023-10-15 205425

and can be set to a suspended panel, like this

Animation (5)

It would be better if you can add an animation for running action
Animation (1)

Fast muter not working with Lora Stack

image
In example above it works only if the first lora stacker is enabled. Enabling any other or any combination of multiple stackers are not working (or only applying first one if enabled).

In fact when any stacker other than first is enabled the output is no longer lora_stack as shown by apply lora stack node throwing a warning
image

power prompt lora prompt found and loaded problem

There are the problem when I load some lora ( It found the another lora even have right path):

🛈 rgthree Power Prompt: Found "Cloth\Rich.safetensors" for "XQ\ziedRichDota2d" in prompt
✓ rgthree Power Prompt: Loaded "Cloth\Rich.safetensors" from prompt
🛈 rgthree Power Prompt: 1 Loras processed; stripping tags for TEXT output.

Workflow Link Fixer doesn't save the fixed workflow

This explains why so many people on Reddit told me that whenever they load my workflow the find a bunch of nodes disconnected, and why on random reloads, I experience the same with two nodes:

Screenshot 2023-09-16 at 20 29 42

However, I cannot fix. When I click the fix and save button, nothing happens. Tried on Vivaldi and Safari. No ad blockers.

Installer issue.

Not a big issue. but when downloading the zip linked here. it saves out with the incorrect folder name, this throws errors with comfyui as it can't find the path it is trying to run.
delete -main from the end and it fixes it.
thats if your installing it this way instead of following the instructions. btw :P

Context Switch not picking the first non-null value

Or better, I probably didn't understand well enough how it should work.

I have the following situation, where 4 input images have to arrive to an upscaler. They come from 4 different functions of the workflow.

At any given, only one of the 4 inputs is really carrying an image.

I can't solve this problem with ordinary switches as, I'm told, ComfyUI will not work if inputs are empty. So, I thought your Context Switch would work as "automatically choose the first non-null context to continue onward with".

Hence the configuration:

Screenshot 2023-09-02 at 10 33 55

Now, let's say that the only non-null image in my case is input 2, which carries the Refiner image. I'd expect that to be selected and passed to the Context Switch. Instead, I receive this error:

Traceback (most recent call last):
  File "/Users/xyz/Desktop/AI/Tools/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xyz/Desktop/AI/Tools/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xyz/Desktop/AI/Tools/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xyz/Desktop/AI/Tools/ComfyUI/comfy_extras/nodes_upscale_model.py", line 39, in upscale
    in_img = image.movedim(-1,-3).to(device)
             ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'movedim'

I also attach the whole workflow for more context:

Context Switch Test

maximum recursion depth exceeded

When I want to use OpenPose after an Upscale, I get this error, but if I take the image before the Upscale, I don't get any error.

File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "D:\ComfyUI_windows_portable\ComfyUI\main.py", line 95, in prompt_worker e.execute(item[2], prompt_id, item[3], item[4]) File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 173, in rgthree_execute return self.old_execute(*args, **kwargs) File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 371, in execute to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute))) File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 371, in <lambda> to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute))) File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 195, in rgthree_recursive_will_execute will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs) File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 195, in rgthree_recursive_will_execute will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs) File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 195, in rgthree_recursive_will_execute will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs) [Previous line repeated 988 more times] File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 179, in rgthree_recursive_will_execute will_execute = RgthreePatchRecursiveExecute_Set_patch_recursive_execution_to_false_if_not_working(unique_id) RecursionError: maximum recursion depth exceeded

Here's the link to my workflow : https://drive.google.com/drive/folders/1-Gt4BCxEeBnFwUrVlITmr6SLwAtIarsG?usp=sharing

image

Error with Context Switch with all null input

Normally I can turn off functionality by breaking the input connection to a part of the circuit I don't want to run - I can't do that with just a context switch though by disabling the inputs - it will stop the process and throw an error - I'm required to put another context block after the switch and mute that instead. This is overly complicated and frustrating, especially without any logic blocks or the ability to disable multiple blocks with one click to work around it more easily.

Odd error and reroute incompatabilities.

Getting an inability to plug rg3 reroutes into normal reroutes, makes converting old workflows over really fiddly.

Also this bug just happened on loading a workflow and it dissapoints me that I might have to ditch rg3 just to run my workflow :<
Screenshot 2023-08-24 014201

Consideration - Fast Actions Button - Is the 'action' button necessary?

Is this button really necessary to confirm the choices?
Indeed, I noticed that when the workflow loads, I have to start by pressing this button to validate the displayed choices. If I don't do that, the actions don't proceed as displayed.
Furthermore, I often forget (my fault) to confirm my choices because, for me, it is logical that when I see 'enable,' for example, the action should be triggered without the need to validate it.

So my question is: could we do without this button?

Bypasser not bypassing? (or me not understanding?)

I'm starting to experiment with the Mute / Bypass Repeater node, using it to bypass the entire Detailer function of my workflow, rather than just some portions of it. It's very useful to save computing cycles, but I'm afraid I've not completely grasped how it works.

In the situation below, I have two main functions generating an image: either the SDXL Base+Refiner or the ReVision. They end up into a context switch which passes the non-null image to the Detailer and the Upscaler, organized in a chain:

Context Switch Test - Detail

I hook all the nodes of the Detailer to a Mute / Bypass Repeater node and that node to a Bypasser node.

At this point, I ask to bypass the Detailer, but not the Upscaler:

Screenshot 2023-09-03 at 01 09 25

I would expect that the generated image (coming either from the Refiner or ReVision) would pass through all the Detailer nodes and end up being processed by the Upscaler. But no.

If the Detailer is bypassed, ComfyUI simply refuses to work. I press Queue Prompt and nothing happens. No errors, no warnings, no console messages. It simply doesn't do anything.

Similarly, if I want to bypass both the Detailer and the Upscaler, and simply keep my image as it comes out of the Refiner or ReVision, I can't. ComfyUI doesn't operate.

For the workflow to work, I have to un-bypass at least the Detailer. Then, it does its thing splendidly. All your nodes are very powerful and useful, thank you.

As usual, the full workflow for reference:

Context Switch Test

Non-backwards compatible changes & tagging

Hey, thanks for your excellent work! Just recently (3hrs ago), you released some non-backwards compatible changes to the repo. That's fine and you can do what you want. Could you please tag your versions though so I can version lock this repo for my workflow?

Thank you so much!

I don't know who you are, but thank you so much for making these nodes, they make the ComfyUI much easier to use!

Nested context muting

Preface:

Perhaps I'm just oblivious to an obvious logic problem

Issue:

Context connected to the output of a muted context are still processed resulting in errors

While attempting to expand my workflow with toggle-able options via muting, I tried using context muting at the end of a mutable section of workflow. Once I muted said section, I would receive errors upon attempting to run. Is this something that can be done as is, or would this require additions to the context module on your part? As I prefaced, perhaps I'm just missing something.

Example:

In my use case I was attempting to create toggles allowing for the saving multiple image outputs in multiple locations using mutable context into the WAS Suite's Image saver. Here's a mock-up example where the second upscaler (U2) workflow is muted:
Screenshot_2023-08-22_02-30-59

Obviously I could mute each of the contexts corresponding to a muted section, but in a more complex non mock-up workflow this would quickly become tedious.

Would it be possible to add a 'Mute' boolean to the I/O of contexts? If the context is able to read and change its mute state according to the boolean it would allow for more complex workflows; especially if it can be carried by the pipe and overridden by new input of the boolean like other I/O. Here's another basic mock-up with U2 disabled showing how such a workflow could be beneficial:
Screenshot_2023-08-22_02-26-42

This functionality would nicely complement the logic nodes of other custom nodes packs.

Post Script:

Seriously I can not thank you enough for the amazing work you've done in releasing these nodes, they really are a game changer!

Feature request: "Hub" node

Almost every day, I find myself wanting a node that:

  1. accepts any input (even multiple inputs of the same type)
  2. picks the first non-null input as output (similarly to what the Context Switch node does)

For example, right now, I'd really need it to pick the first non-null image among many possible generated by different parts of my workflow and send that image to another node to be saved with metadata readable by A1111/SD.Next/SD Prompt Reader:

Screenshot 2023-09-17 at 09 50 40

Maybe it's the wrong way to think about the flow, but it's very intuitive to me. And I had other use cases for such a node.

Thanks!

rgthree-comfy module for custom nodes: glob() got an unexpected keyword argument 'root_dir'

Not sure why this is happening, it may be after I installed mtb but I installed a few so it could be anything.. but I wanted to let you know this error is being thrown.

[comfy_mtb] | INFO -> loaded 52 nodes successfuly
[comfy_mtb] | INFO -> Some nodes (3) could not be loaded. This can be ignored, but go to http://none:6006/mtb if you want more information.
Traceback (most recent call last):
File "/notebooks/ComfyUI/nodes.py", line 1735, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/notebooks/ComfyUI/custom_nodes/rgthree-comfy/init.py", line 98, in
for file in glob.glob('.py', root_dir=DIR_PY) + glob.glob('.js', root_dir=os.path.join(DIR_DEV_WEB, 'js')):
TypeError: glob() got an unexpected keyword argument 'root_dir'

Cannot import /notebooks/ComfyUI/custom_nodes/rgthree-comfy module for custom nodes: glob() got an unexpected keyword argument 'root_dir'

I was able to fix this by replacing this line

with this

for file in glob.glob('*.py', root_dir=DIR_PY) + glob.glob('*.js', root_dir=os.path.join(DIR_DEV_WEB, 'js')):

for file in glob.glob(os.path.join(DIR_PY, '.py')) + glob.glob(os.path.join(DIR_DEV_WEB, 'js', '.js')):

not tested on windows..

Fix for multiple DisplayInt nodes

When there are multiple DisplayInt nodes in a graph, whenever any of them gets executed, the text widget of the most recently created node gets updated instead of the text widget of the executing node because the text widget variable showValueWidget in js/display_int.js is being shared between all the nodes. This can be fixed by attaching it to the node object (this) instead:

 import { app } from "../../scripts/app.js";
 import { ComfyWidgets } from "../../scripts/widgets.js";
 import { addConnectionLayoutSupport } from "./utils.js";
 app.registerExtension({
     name: "rgthree.DisplayInt",
     async beforeRegisterNodeDef(nodeType, nodeData, app) {
         if (nodeData.name === "Display Int (rgthree)") {
-            let showValueWidget;
             nodeType.title_mode = LiteGraph.NO_TITLE;
             const onNodeCreated = nodeType.prototype.onNodeCreated;
             nodeType.prototype.onNodeCreated = function () {
                 onNodeCreated ? onNodeCreated.apply(this, []) : undefined;
-                showValueWidget = ComfyWidgets["STRING"](this, "output", ["STRING", { multiline: true }], app).widget;
-                showValueWidget.inputEl.readOnly = true;
-                showValueWidget.serializeValue = async (node, index) => {
+                this.showValueWidget = ComfyWidgets["STRING"](this, "output", ["STRING", { multiline: true }], app).widget;
+                this.showValueWidget.inputEl.readOnly = true;
+                this.showValueWidget.serializeValue = async (node, index) => {
                     node.widgets_values[index] = '';
                     return '';
                 };
             };
             addConnectionLayoutSupport(nodeType, app, [['Left'], ['Right']]);
             const onExecuted = nodeType.prototype.onExecuted;
             nodeType.prototype.onExecuted = function (message) {
                 onExecuted === null || onExecuted === void 0 ? void 0 : onExecuted.apply(this, [message]);
-                showValueWidget.value = message.text[0];
+                this.showValueWidget.value = message.text[0];
             };
         }
     },
 });

Graphic glitch

This is not really an issue, more of an inconsistency..
Your excellent Nodes don't take into account the "Link Render Mode" setting of the user and draw things like its always in the "Spline" setting.
I use "Linear" and it draws the cable's middle dot in an offset
Bug1a
The reason must be that it thinks the cables are like this
Bug1b
Not a big deal, just a glitch.. 😉

.. and another thanks for your really great Nodes!

Request: Combine to Mute or Bypass all combined inputs at once

Title says it all. I want to combine a bunch of inputs into one 'button' to press to be able to enable on/off certain generations and features.

Current implementation, I don't see a way to do this, as once combined each input is still individually selectable

Personally, I would implement it as a toggle to the combiner -> (combine inputs into 1)

Reroute nodes keep disconnecting

Unfortunately, I have to report that the recent change did not fix the issue. After the Fix in Place of last week, I still have a few nodes that keep disconnecting randomly every time I reload the workflow or restart ComfyUI.

What's worse, these nodes would be very hard to impossible to troubleshoot for anyone not intimately familiar with the design decision I made for my workflow. And the new fix function doesn't even detect the issue.

Version 4.0 is ready to go, but I cannot release it until the reroute nodes issue is solved, and I only use your reroute nodes :)

Happy to share the new workflow, if you need it.

KSampler is not working

Error occurred when executing KSampler:

module 'comfy.sample' has no attribute 'broadcast_cond'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1237, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\AIT\AITemplate\AITemplate.py", line 176, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 109, in animatediff_sample
return orig_comfy_sample(model, *args, **kwargs)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\AIT\AITemplate\AITemplate.py", line 290, in sample
positive_copy = comfy.sample.broadcast_cond(positive, noise.shape[0], device)

Suggestion: Custom Pipe Node

The 'pipe' nodes already exist, but they are predefined. I rarely use them because they don't allow me to transmit all the data I want.

The idea would be to connect any node to the 'custom pipe' node in order to truly have a workflow with as few lines as possible.

custom pipe

Do you think such a node makes sense, and does it appeal to you?

comfyui search become very long

Comfyui search become very long because the samplers get added to the search options this happens when I activate this node.
normal (without the node)
image

with the node
image
image

missing nodes in new installation

Hi, I am very new to your extension and comfyui.
Just install it to use your seed node, but I can not find it.
I only get Reroute, Node Combiner, Fast Bypasser and Fast Muter in the node menu.

Where are Seed, Lora Loader Stack and Context?
When will be Power Prompt realese?

I would suggest for Reroute node shows a fast switch to change the direction, instead of doing it from the node menu.

USE CASE question: how to use bypass with a "conditional" workflow

Hi,

I have a node that picks a prompt process based random integer. Given an input, the workflow runs one of the nodes that corresponds to the integer picked. However,r in the console, I see the non-selected nodes are still doing their prompting. Is it possible to use the mute/bypass nodes to turn them off? The workflow is shown below:

image

So really what I want to do is if Wildcards is picked, to bypass/mute the other three, for example.

Feature request: Display Any node printing checkpoint name + passing inputs to other nodes

As the title says: the new Display Any node is very useful for debugging, but it would be tremendously more useful if it would do two additional things:

  1. Print the checkpoint name in the same way it does for the sampler name and the scheduler name. Right now, an attempt to link a Model output in a Checkpoint Loader node to the input of a Display Any node generates something like this: <comfy.model_patcher.ModelPatcher object at 0x2d0f6b950>

  2. Pass any received input to other nodes. The printing within the node is much needed (I use the ttn textDebug for this, but it stopped printing the name inside the node weeks ago and it's not optimal). However, values like checkpoint name, sampler name, and scheduler name I'd like to print to terminal, concat with my labels, and save to files for various reasons.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.