Coder Social home page Coder Social logo

comfyui-workflow-component's Introduction

Youtube Badge

ComfyUI-Workflow-Component

This is a side project to experiment with using workflows as components. This extension, as an extension of the Proof of Concept, lacks many features, is unstable, and has many parts that do not function properly. There is a high possibility that the existing components created may not be compatible during the update process.

Notice

  • V0.41.4 requires latest version of Impact Pack (V3.20) and latest version of ComfyUI (Aug 18th).
  • Some of the components provided by default are implemented using other custom nodes. To use those components, the custom nodes used within the component need to be available. If you are not using those specific components, you can safely ignore the warning as it will not affect other components.

Installation

  1. cd custom_nodes
  2. git clone https://github.com/ltdrdata/ComfyUI-Workflow-Component.git
  3. Restart ComfyUI

How To Build Component

component-build

  • Through the ComponentBuilder under the ComponentInput node, specify the input interface of the component, and specify the output interface of the component through the ComponentOutput node.
  • The slot name of the ComponentInput/Output node is used as the external interface name of the component.
  • The order of the interface is determined by sorting the titles of the nodes in ascending order.

component-menu

  • Once all the component workflows have been created, you can save them through the "Export As Component" option in the menu. The file extension will be .component.json.

  • After adding a Note and changing the title to "input-spec", you can set default values for specific input slots by following the format:

    input slot name:(default,value), (placeholder, text).

  • For STRING inputs, you can use to include a placeholder.

  • Note: Please make sure to avoid using the same name for input and output interface nodes in the component.

How To Use Component

component-files

  • If you place the .components.json file, which is stored in the "components" subdirectory, and then restart ComfyUI, you will be able to add the corresponding component that starts with "##." component-menu2

component-use

  • When you load a .component.json file or load a workflow created with .component.json, the component is automatically loaded.
  • This tutorial video provides a detailed walkthrough of the process of creating a component.

How To Edit Component

settings

  • If the Require confirmation for the component edit mode when loading a .component.json file. checkbox is unchecked, the .component.json file will always be loaded in the usage mode when loaded. To enable editing, please check the corresponding checkbox and click "OK" in the edit mode confirmation window to proceed.

Example

workflow

  • Once you install the Workflow Component and download this image, you can drag and drop it into comfyui. This will load the component and open the workflow.
  • The component used in this example is composed of nodes from the ComfyUI Impact Pack, so the installation of ComfyUI Impact Pack is required. If it is not installed, an error message will appear indicating that the node is missing. You can install it through the "missing nodes" installation menu in ComfyUI-Manager. sample

Image Refiner

image-refiner

How To Use

  • Image Refiner is an interactive image enhancement tool that operates based on Workflow Components.
  • There is an interface component in the bottom component combo box that accepts one image as input and outputs one image as output. If the input interface of the component has interfaces other than INT, FLOAT, STRING, COMBO, BASIC_PIPE, MODEL, VAE, CONDITIONING, LATENT, IMAGE, it cannot be used.
    • However, currently, LATENT, CONDITIONING are not supported.
  • Components that end with .ir are displayed above other components. Please save the component designed for Image Refiner as component_name.ir.component.json.
  • When you press the "Generate" button, it will generate images by inpainting the masked areas based on the number specified in "# of cand." It will also add layers to the generated images.
    • [√]: If checked, the layer will be visible. If unchecked, the layer will be hidden.
    • R: Discard the current layer image and regenerate it with the same settings but with a changed seed for the specified number of candidates (# of cand).
    • S: Show a gallery dialog where you can view and switch between the generated candidate images for the current layer.
    • M: Load the mask used for generating the current layer.
    • X: Permanently delete the current layer.
  • The base image for inpainting is the currently displayed image. If you uncheck and hide a layer, it will be excluded from the inpainting process.
  • Flatten: Combines all the current layers into a base image, maintaining their current appearance.
  • Show image: Opens a new tab with the current visible state as the resulting image.
  • Load image: Discards the current work and performs a new operation with the loaded image.
    • This feature is useful when incorporating work done with external painting tools.
  • Mask/Pen toggle:
    • When in Pen mode, the current drawing is added to the layer, and when in Mask mode, generation is performed using the current mask area.
  • Control
    • Wheel: brush size adjustment
    • Left button-Drag: draw mask
    • Right button-Drag: erase mask
    • Ctrl-Wheel: Zoom adjustment
    • Ctrl-Drag: Pan
    • Esc: Close

Tutorial video

Requirements

Todo

  • Workflow Component
    • Default interface name
    • Support of refresh combo (ex. ckpt, images, lora, ...)
    • Hot loading
    • used components must be included into workflow
      • Save .json
      • Load .json
      • Save .png/.latent
      • Load .png/.latent
    • Efficient traversal
    • Better internal error message
    • Report missing nodes in components when component is loaded
    • reroute problem fix
    • Resolve conflicts between components with the same name based on hash
    • Set the currently configured widget value as the default value for component interface
    • A feature that enables selecting a graceful termination for a specific execution path in a node instead of a crash
      • 'None' input is regarded as stop execute current execution path
    • ExecutionSwitch node
    • Unconnected output checker to avoid inefficient execution
    • ExecutionOneOf race condition issue
    • A feature that disable a specific optional input slot
      • Handling the workflow execution of a node composed solely of optional inputs
    • Component nesting
    • Incomplete workflow checker
    • Provide random value executing inside component workflow.
    • Provide a validation checker when writing a component.
    • Provide a special input that can receive traces executed following a workflow.
  • Image Refiner
    • Layer flattening feature
    • Simple painting feature
      • Drawing layer
      • Pass drawings to prompt
      • Color palette
    • Cropped inpainting feature
    • Progress with preview
    • Support LATENT, CONDITIONING
    • Preset values for components
    • Mask editing feature for generated layer
    • Layer reodering
    • Improving the mask to make it less ugly

Credit

  • ComfyUI/ComfyUI - A powerful and modular stable diffusion GUI.
  • pythongosssss/ComfyUI-WD14-Tagger - A very cool badge-style progress came from here.

comfyui-workflow-component's People

Contributors

lcolok avatar ltdrdata avatar melmass avatar philhk avatar schneiderlin avatar tinyterra 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

comfyui-workflow-component's Issues

[feature req] Can't do Different Controlnet Loader Inputs

The components work great! I dunno why the description says otherwise as I never gotten into any bug so far, but was just wondering, is it possible to have separate naming for input variables, e.g. for Controlnet, they're all controlnets and when I tried to stack inpaint + others, it isn't working because the component only recognizes the controlnet as one variable and when I use it as a component there is only one input socket even though I created 2 different input nodes inside the component.

Issue with Impact Switch in Component flow?

Attempting to replicate the following logic in a component:
opt-1
Using an optional input so the highest index input will always be used (so index 0 if only the required input is supplied, index 1 if the optional input is also supplied):
opt2
Produces the following error:
opt3
Not sure if I'm misusing the nodes (pilot error) of if there's a legitimate issue, and I also wouldn't be surprised if there were a better way of achieving what I'm trying to do, so apologies if the issue is something I'm doing.
Thanks in advance, you're doing amazing work please keep it up!

Error with image output on custom component

Hey. First up, awesome project. ComfyUI is great but definitely in need of something like this.

So I'm getting an error when trying to get an image out of my custom component. Here's the error:

Error occurred when executing PreviewImage:

'NoneType' object is not subscriptable

File "D:\Stable Diffusion\UI\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\Stable Diffusion\UI\ComfyUI\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 "D:\Stable Diffusion\UI\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\Stable Diffusion\UI\ComfyUI\ComfyUI\nodes.py", line 1265, in save_images
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])

I've attached both my custom component and a workflow that uses it (you'll need to select a relevant model from your machine). Just rename from .txt. to .json.

Example.txt
FaceDetailerComponent.txt

Node types were not found...

Hey ltdrdata,

I watched your video tutorial on the topic: "ComfyUI Workflow Component - Component Creation Tutorial". I exported the newly created component using the Export As Component button. When I drag and drop the component into an existing workflow it is also displayed correctly. If I now save the workflow, close Comfyui and start it again, I always get the following error:

node types-not-found

Error: When loading the graph, the following node types were not found:
"## AIO-Advance-KSampler [b8a908]"
Nodes that have failed to load will show as red on the graph.

Where is the error in my walkthrough and how can I fix it?

run Image Refiner, after drawing mask and Regenerate, no processing, and cmd show:

run Image Refiner, after drawing mask and Regenerate, no processing, and cmd show:
(by the way , comfyui and all your extension is lastest, and "fetch updates" in the manager, still no work)

model_type EPS
adm 0
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
missing {'cond_stage_model.text_projection', 'cond_stage_model.logit_scale'}
left over keys: dict_keys(['cond_stage_model.transformer.text_model.embeddings.position_ids'])
loading new
[DBG] work: 17 (MaskToSEGS) / worklist: []

of Detected SEGS: 1

[DBG] work: 32 (DetailerForEachTestPipe) / worklist: []
!!! Exception during processing !!!
Traceback (most recent call last):
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 159, in exception_helper
task()
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 372, in task
output_data, output_ui = get_output_data(obj, input_data_all)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 88, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 81, in map_node_over_list
results.append(getattr(obj, func)(**params))
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 1049, in doit
DetailerForEach.do_detail(image, segs, model, clip, vae, guide_size, guide_size_for, max_size, seed, steps, cfg,
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 204, in do_detail
enhanced_pil, cnet_pil = core.enhance_detail(cropped_image, model, clip, vae, guide_size, guide_size_for_bbox, max_size,
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\core.py", line 166, in enhance_detail
if len(noise_mask.shape) == 3:
AttributeError: 'NoneType' object has no attribute 'shape'

An error occurred in the 'DetailerForEachDebugPipe'(id=32) node within the component '## ## mask-detailer.ir [0a5d50]'(id=-1).
ERROR MESSAGE: 'NoneType' object has no attribute 'shape'

Prompt executed in 0.04 seconds
Error handling request
Traceback (most recent call last):
File "F:\ComfyUI\python_embeded\lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "F:\ComfyUI\python_embeded\lib\site-packages\aiohttp\web_app.py", line 504, in _handle
resp = await handler(request)
File "F:\ComfyUI\python_embeded\lib\site-packages\aiohttp\web_middlewares.py", line 117, in impl
return await handler(request)
File "F:\ComfyUI\ComfyUI\server.py", line 46, in cache_control
response: web.Response = await handler(request)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\custom_server.py", line 69, in imagerefiner_generate
result = ir.generate(base_pil.convert('RGB'), mask_pil, prompt_data)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\imagerefiner.py", line 175, in generate
output_data, _ = ee.get_output_data(class_def(), input_data_all)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 88, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 81, in map_node_over_list
results.append(getattr(obj, func)(**params))
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 259, in doit
return workflow_execution.execute(component_name, prompt, workflow,
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\workflow_execution.py", line 224, in execute
raise Exception(msg)
Exception:

Component internal error on [-1]:DetailerForEachDebugPipe
Error:'NoneType' object has no attribute 'shape'
Traceback:
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 159, in exception_helper
task()
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 372, in task
output_data, output_ui = get_output_data(obj, input_data_all)
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 88, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\execution_experimental.py", line 81, in map_node_over_list
results.append(getattr(obj, func)(**params))
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 1049, in doit
DetailerForEach.do_detail(image, segs, model, clip, vae, guide_size, guide_size_for, max_size, seed, steps, cfg,
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 204, in do_detail
enhanced_pil, cnet_pil = core.enhance_detail(cropped_image, model, clip, vae, guide_size, guide_size_for_bbox, max_size,
    File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\core.py", line 166, in enhance_detail
if len(noise_mask.shape) == 3:


Image Refiner doesn't work after ComfyUI's update.

Hi, I've been using the manual inpainting workflow, as it's quick, handy and awesome feature, but after update of ComfyUI (Updating all via Manager?) doesn't work anymore, also options we've had before i.e mask-detailer.ir are not visible options to choose from. I'm using Pinokio to run the ComfyUI and here is the error code:

..........Connected!

model_type EPS

adm 2816

making attention of type 'vanilla-pytorch' with 512 in_channels

Working with z of shape (1, 4, 32, 32) = 4096 dimensions.

making attention of type 'vanilla-pytorch' with 512 in_channels

missing {'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}

loading new

Error handling request

Traceback (most recent call last):

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\env\lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request

resp = await request_handler(request)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\env\lib\site-packages\aiohttp\web_app.py", line 504, in _handle

resp = await handler(request)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\env\lib\site-packages\aiohttp\web_middlewares.py", line 117, in impl

return await handler(request)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\[server.py](https://server.py/)", line 43, in cache_control

response: web.Response = await handler(request)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\custom_server.py", line 69, in imagerefiner_generate

result = ir.generate(base_pil.convert('RGB'), mask_pil, prompt_data)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\[imagerefiner.py](https://imagerefiner.py/)", line 171, in generate

input_data_all = prepare_input(class_def, merged_pil, mask_pil, prompt_data)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\[imagerefiner.py](https://imagerefiner.py/)", line 94, in prepare_input

model, clip, vae = load_checkpoint(v['checkpoint'])

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\image_refiner\[imagerefiner.py](https://imagerefiner.py/)", line 38, in load_checkpoint

model, clip, vae, _ = comfy_nodes.CheckpointLoaderSimple().load_checkpoint(ckpt_name)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\[nodes.py](https://nodes.py/)", line 446, in load_checkpoint

out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\comfy\[sd.py](https://sd.py/)", line 1331, in load_checkpoint_guess_config

sd = utils.load_torch_file(ckpt_path)

File "C:\Users\mikas\pinokio\api\comfyui.pinokio.git\ComfyUI\comfy\[utils.py](https://utils.py/)", line 10, in load_torch_file

if ckpt.lower().endswith(".safetensors"):

AttributeError: 'NoneType' object has no attribute 'lower'

Any help is appreciated, thanks!

[Bug]Unable to create components

I was able to create components without any problems, but after updating ComfyUI and all extensions today, I have the following problems.

  1. when I create a component, the inputs are corrupted
  2. component cannot be saved with "Export As Component

Tried

  • When I load a previously created component and re-create it, the inputs are corrupted.
  • Reverted to October 1 and 5 versions, but no improvement.
  • When I revert to the previous version, problem 2 occurs.
  • When I revert to the latest version, problem 2 still remains.
  • The server and browser are closed and all browser caches are deleted, but the same thing happens.
  • The previously created components are working fine.

The hashes of ComfyUI and extensions currently in use are as follows(All the latest versions at this time)

ComfyUI:1f2f4eaa6f04660a7df7d71eede3118d09b1c2c2
ComfyUI-Workflow-Component:9e8ccf5fa163cf2febabffff40989f77e8c51e62
ComfyUI-Impact-Pack: 12b5b1a5709d7ef11b384ee239a1575572f4d116

img_0001 3

Allowing loop on workflow

  • worklist_will_execute must check visited nodes to avoid redundant
  • don't delete output cache unless prompt is changed in worklist_delete_changes_...
    • If a node in the middle of a loop is edited, all results after that point are invalidated. (This includes the starting point of the loop, as it becomes a middle node of the loop.)
  • provide loop variable to node
  • determine termination of loop

Missing nodes

I'd love to try this but i'm getting this error after installing.

I'm using the standalone Comfy build, Python 3.10, Windows 10

[Workflow-Component] '## img-ksample-latent.component-tiled [7146f6]' is broken. Maybe there are missing nodes. (INFO: 'BNK_TiledKSampler') Traceback (most recent call last): File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 174, in get_input_types_dynamic build_input_types(i, input_mapping, input_types, node, node_config_map) File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 320, in build_input_types node_input_types = comfy_nodes.NODE_CLASS_MAPPINGS[node_type].INPUT_TYPES() KeyError: 'BNK_TiledKSampler' [Workflow-Component] '## sdxl-ksample [1743ab]' is broken. Maybe there are missing nodes. (INFO: 'Multiply') Traceback (most recent call last): File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 174, in get_input_types_dynamic build_input_types(i, input_mapping, input_types, node, node_config_map) File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 320, in build_input_types node_input_types = comfy_nodes.NODE_CLASS_MAPPINGS[node_type].INPUT_TYPES() KeyError: 'Multiply' [Workflow-Component] '## 2obj [a9bc98]' is broken. Maybe there are missing nodes. (INFO: 'Integer') Traceback (most recent call last): File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 174, in get_input_types_dynamic build_input_types(i, input_mapping, input_types, node, node_config_map) File "E:\Comfy\ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 320, in build_input_types node_input_types = comfy_nodes.NODE_CLASS_MAPPINGS[node_type].INPUT_TYPES() KeyError: 'Integer'

Not sure if my fault or bug.

So when attempting to use the in-paint "and at no other time" i get this error.

Error handling request
Traceback (most recent call last):
  File "/home/john/.local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/.local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/.local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/server.py", line 41, in cache_control
    response: web.Response = await handler(request)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/custom_nodes/ComfyUI-Workflow-Component/image_refiner/custom_server.py", line 69, in imagerefiner_generate
    result = ir.generate(base_pil.convert('RGB'), mask_pil, prompt_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/custom_nodes/ComfyUI-Workflow-Component/image_refiner/imagerefiner.py", line 174, in generate
    input_data_all = prepare_input(class_def, merged_pil, mask_pil, prompt_data)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/custom_nodes/ComfyUI-Workflow-Component/image_refiner/imagerefiner.py", line 94, in prepare_input
    model, clip, vae = load_checkpoint(v['checkpoint'])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/custom_nodes/ComfyUI-Workflow-Component/image_refiner/imagerefiner.py", line 38, in load_checkpoint
    model, clip, vae = comfy_nodes.CheckpointLoaderSimple().load_checkpoint(ckpt_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/nodes.py", line 541, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/comfy/sd.py", line 535, in load_checkpoint_guess_config
    clip = CLIP(clip_target, embedding_directory=embedding_directory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/comfy/sd.py", line 103, in __init__
    self.cond_stage_model = clip(**(params))
                            ^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/comfy/sd1_clip.py", line 507, in __init__
    setattr(self, self.clip, clip_model(device=device, dtype=dtype, **kwargs))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/comfy/sd1_clip.py", line 81, in __init__
    self.transformer = model_class(config, dtype, device, comfy.ops.manual_cast)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/Applications/temp/ComfyUI-AAA-112/comfy/clip_model.py", line 124, in __init__
    self.text_projection.weight.copy_(torch.eye(embed_dim))
RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.

I hope this means something to you if its a bug, and if its my fault instead of a bug it would be cool if some one could tell me whats happening and how i broke it XD <3.

Some UI funnies with Image Refiner

I really love the concept of the image refiner - it has so much potential (have you thought about breaking it out to be it's own custom node? I think many people would want to use it without wanting to set up workflows etc)

I have encountered some strange UI issues when I try to use it however - it works fine if I zoom out a long way so that all the inputs fall within the main div.

I'm using Chrome Version 120.0.6099.129 and MacOS Sonoma if that makes any difference

Let me know if you want any more details 😊

02b20c9b-07e2-47d6-91b2-34e38dca6166.mp4

UI corruption after loading a component via Drag and Drop

When I drag and drop a component onto the canvas, it loads successfully. However, if I try to click on the component ComfyUI all nodes disappear (leaving only pipes) and the canvas becomes non-responsive until I refresh page.

This doesn't happen if I select the component via Right Click - Add Node

loading_component_bug

Red Wall Error Message

Will start by a disclaimer that this may be a standalone circumstance, given my workflow outlay.

I built out an entire workflow, base generation > hires Fix > face fix > tiled upscaling. To make it more versatile, I added simple reroute jumpers between each process where I break the image output going to the next process. This does under normal circumstances highlight those nodes stating they are missing an input, but allows the other nodes to still run through the process and complete those flows.
After I downloaded your pack, just even having the folder in my custom_nodes folder and running the same above process (even without yet implementing any nodes within my flow), instead of the UI highlighting those same nodes, it just throws up a redwall error and doesn't allow any processing to begin. Removing the folder and reloading, then back to working.

below images:
--redwall error message after adding Workflow Component to custom_nodes folder
--highlighted node with arrows showing my jumper from image output to input for next process.
Redwall error with Component pack in custom_nodes
Highlighted error without Component pack in custom_nodes

How to Update a component?

Hello! Thanks so much for your work, this repo makes things so much easier!

I made a component, added it to my workflow, and everything works as it should even after a restart. But, for example, I need to update the component itself, add new nodes there, or maybe just change the default values inside. I open the component, edit it, resave it to a new json file, and overwrite the old component in the ComfyUI-Workflow-Component\components\ folder with this file.

After this, an error occurs in my old workflows - the new component has a new ID, as I understand it, so I need to manually replace all components in all workflows.

How can I update a component so that there is no error when loading?
(the screenshots show that the nodes have different IDs)

Снимок экрана 2024-05-10 221100

Снимок экрана 2024-05-10 221048

Reroutes Confuse in/out parameters

If the only thing connected to an input/output component is a reroute (even if its connected to another node with a type) you will get errors when you try to use a saved workflow component. If multiple nodes are connected to either the in/out this is enough to help it figure out what the proper type is.

This one is a mild inconvenience, but figure I would post it since others could get confused by the same issue. Initially took me an hour or so of debugging to root cause.

Disable LORA dropdown selector

When I do not want to use any LORA, the dropdown is auto selected.

We need a CheckBox to enable/disable LORA in dropdown, or a "----" as first option in the dropdown.

How to edit custom workflows?

This is an awesome repo. I have been loving the ability to simplify my workflows with your nodes.

Once imported using load, new components are showing up in the Workflow -> Temp folder. Once there, I am unable to edit the underlying workflow. Is there a way to remove items from the Temp folder? Is there another way to open a component workflow as its underlying workflow instead of as a component?

Thanks again.

Image Refiner missing components

I'm trying to use the image refiner and have only been able to select components a single time. Ever since I restarted comfyui I do not get the list of components.

Not

image

Conflicts with ComfyUI-Allor

After installing ComfyUI-Workflow-Component, the following error occurs.

Traceback (most recent call last):
File "/home/bob/ComfyUI/nodes.py", line 1516, 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 "/home/bob/ComfyUI/custom_nodes/ComfyUI-Allor/init.py", line 8, in
loader.setup_override()
File "/home/bob/ComfyUI/custom_nodes/ComfyUI-Allor/Loader.py", line 51, in setup_override
override_nodes_len += override(lambda item: not item[1].CATEGORY.startswith("image/postprocessing"))
File "/home/bob/ComfyUI/custom_nodes/ComfyUI-Allor/Loader.py", line 44, in override
nodes.NODE_CLASS_MAPPINGS = dict(
File "/home/bob/ComfyUI/custom_nodes/ComfyUI-Allor/Loader.py", line 51, in
override_nodes_len += override(lambda item: not item[1].CATEGORY.startswith("image/postprocessing"))
AttributeError: type object 'ExecutionSwitch' has no attribute 'CATEGORY'

Cannot import /home/bob/ComfyUI/custom_nodes/ComfyUI-Allor module for custom nodes: type object 'ExecutionSwitch' has no attribute 'CATEGORY'

0.0 seconds (IMPORT FAILED): /home/bob/ComfyUI/custom_nodes/ComfyUI-Allor

After I removed ComfyUI-Workflow-Component, the error no longer occurs and ComfyUI-Allor can be loaded correctly.

TypeError: Cannot read properties of undefined (reading 'node_errors')

Problem: Upon enable Workflow component with Comfy UI I got this error even running with workflow from ComfyUI Example repo.
Also the seed number won't random after each generation.

Solution: Remove Workflow component by install a clean version of Comfy UI. Hope this can give you some clue to address this issue.

image
image
image

warning message started to appear after updating the Derfuu_ComfyUI_ModdedNodes nodes.

a warning message started to appear after updating the Derfuu_ComfyUI_ModdedNodes nodes.

The message is: "[Workflow-Component] '## sdxl-ksample [3c7e70]' is broken. Maybe there are missing nodes. (INFO: ### [ERROR] "Multiply" node is not installed. Please install that node through ComfyUI-Mananger. ###)"

So I edited the sdxl-ksample.component.json component, modifying the nodes that were considered missing and now the message is no longer appearing. I attach the component that I modified to be reviewed, evaluated and perhaps to replace the current node.

sdxl-ksample.component.json

Implementing a loop structure to solve synchronization issues

  • front end
    • node color marker for identifying the same loop component
      • async update / color is determined by id of loop control node
  • back end
    • calculating the loop component and labeling the internal nodes of the loop with the loop component label based on the ID of the dominating loop control node.
    • detecting when a loop control node does not dominate the passed input and generating a validation error.
    • implementing a functionality to delete the backend value of the corresponding loop component when the loop control node is executed.
      • If values like the loader need to be provided within the loop, they should be bundled using zip to pass them as input to the loop control, and then unzip can be used to separate and use them accordingly.

feature request - Multiple inputs of the same type

I want to input three different images for processing, but it seems that even if I add three image input nodes, it is still regarded as the same input and will cause an error

got prompt
'🔥 - Failed to save json data.'
'🔥 - Got prompt'
len(prompt): 5
'🔥 - 5 Nodes not included in prompt but is activated'
ERROR:root:Failed to validate prompt for output 6:
ERROR:root:* ## 后处理-合成对比照 [f679bb] 3:
ERROR:root: - Return type mismatch between linked nodes: image, IMAGE != *
ERROR:root:Output will be ignored
[rgthree] Using rgthree's optimized recursive execution.
[profiler] #5 PreviewImage: 0.0 seconds, total 0.0 seconds(#2)
Prompt executed in 0.02 seconds

Nested Calls with images in/out support?

Extremely useful repository, thank you so much!

I have noticed that when using a saved component in another saved component (depth of 2) I get errors when passing around images. I tried this in the simplest setup with two layers of just passing in and out an image (with preview images inside).
image ->ImageTest2 -> ImageTest1 -> ImageTest2 -> image

Not sure if this is an easy-to-fix bug or if this just isn't a supported feature yet, but figure I would ask :)

Error occurred when executing ## ImageTest2 [d709cf]:

Component internal error on [6]:## ImageTest1 [af5a6c]
Error:'extra_pnginfo'
...

ComfyUI\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 266, in doit
return workflow_execution.execute(component_name, copy.deepcopy(prompt), workflow,

...

Component\workflow_component\workflow_execution.py", line 137, in execute
for node in kwargs['extra_pnginfo']['workflow']['nodes']:

Import failed

Traceback (most recent call last):
  File "/home/ahao/Documents/ComfyUI/nodes.py", line 1688, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Workflow-Component/__init__.py", line 47, in <module>
    import workflow_component.custom_server
  File "/home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Workflow-Component/workflow_component/custom_server.py", line 42, in <module>
    server.PromptServer.instance.add_on_prompt_handler(onprompt)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PromptServer' object has no attribute 'add_on_prompt_handler'

Cannot import /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Workflow-Component module for custom nodes: 'PromptServer' object has no attribute 'add_on_prompt_handler'

Import times for custom nodes:
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/failfast-comfyui-extensions
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-WD14-Tagger
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/bilbox-comfyui
   0.0 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Manager
   0.1 seconds (IMPORT FAILED): /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Workflow-Component
   0.4 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/efficiency-nodes-comfyui
   0.7 seconds: /home/ahao/Documents/ComfyUI/custom_nodes/ComfyUI-Impact-Pack

first time installation bug

FETCH DATA from: D:\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager\extension-node-map.json
[Workflow-Component] '## img-ksample-latent.component-tiled [77a7ed]' is broken. Maybe there are missing nodes. (INFO: ### [ERROR] "BNK_TiledKSampler" node is not installed. Please install that node through ComfyUI-Mananger. ###)
Traceback (most recent call last):
File "D:\ComfyUI-Zluda\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 209, in get_input_types_dynamic
build_input_types(i, input_mapping, input_types, node, node_config_map, spec_map)
File "D:\ComfyUI-Zluda\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 357, in build_input_types
raise Exception(errmsg)
Exception: ### [ERROR] "BNK_TiledKSampler" node is not installed. Please install that node through ComfyUI-Mananger. ###
[Workflow-Component] '## sdxl-ksample [3c7e70]' is broken. Maybe there are missing nodes. (INFO: ### [ERROR] "Multiply" node is not installed. Please install that node through ComfyUI-Mananger. ###)
Traceback (most recent call last):
File "D:\ComfyUI-Zluda\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 209, in get_input_types_dynamic
build_input_types(i, input_mapping, input_types, node, node_config_map, spec_map)
File "D:\ComfyUI-Zluda\custom_nodes\ComfyUI-Workflow-Component\workflow_component\component_loader.py", line 357, in build_input_types
raise Exception(errmsg)
Exception: ### [ERROR] "Multiply" node is not installed. Please install that node through ComfyUI-Mananger. ###

All nodes in chain triggered from workflow component even when no changes

I've REALLY been wanting to use this but I'm having an issue that I can't figure out if a bug, limitation or user error, hoping for a confirmation.

Is it normal that on every generation it will restart from back up the chain of nodes from the workflow component even when I made no changes to it?

Even the simplest test I made with this component:

test

Adding it to my workflow before a kSampler and typing a prompt in it, hitting "Prompt queue" multiple times it will start from that component no matter if it was untouched in-between generations . It will keep generating the same image over and over. No changes anywhere else in the workflow, using fixed seed, etc.

Any idea?

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.