ComfyUI custom node for ComfyUI_WolfBypass
  • Python 91%
  • JavaScript 8.6%
  • CSS 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-18 00:42:55 +02:00
build Add text markdown editor and text projection UI components to WolfBypass. Introduce new scripts for markdown editing with live preview and a UI for text projection with draggable anchors and style sliders. Update script loading to include these new components, enhancing user interaction and customization options. 2026-03-03 16:09:18 +01:00
docs Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
scripts Implement per-block strength control for LoRA loading and bypass functionality. Introduce new nodes for block inspection, merging, and scriptable loading, enhancing flexibility in managing LoRA adapters. Update existing modules to support structured block filtering and strength application across various models. 2026-02-27 22:47:33 +01:00
web Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
.gitignore Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00
__init__.py Fix NameError: remove undefined MERGE_MAPPINGS references 2026-04-18 00:42:55 +02:00
block_filter.py Implement per-block strength control for LoRA loading and bypass functionality. Introduce new nodes for block inspection, merging, and scriptable loading, enhancing flexibility in managing LoRA adapters. Update existing modules to support structured block filtering and strength application across various models. 2026-02-27 22:47:33 +01:00
block_weights.py Enhance LoRA loading and inspection capabilities by adding a merge function option for per-block strengths. Introduce block_strengths_debug output for improved integration with inspector nodes. Update relevant nodes to support this feature, ensuring compatibility with existing workflows. 2026-02-28 03:03:39 +01:00
CHANGELOG.md Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00
config.yaml Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
lora_scanner.py Implement per-block strength control for LoRA loading and bypass functionality. Introduce new nodes for block inspection, merging, and scriptable loading, enhancing flexibility in managing LoRA adapters. Update existing modules to support structured block filtering and strength application across various models. 2026-02-27 22:47:33 +01:00
nodes.py Implement per-block strength control for LoRA loading and bypass functionality. Introduce new nodes for block inspection, merging, and scriptable loading, enhancing flexibility in managing LoRA adapters. Update existing modules to support structured block filtering and strength application across various models. 2026-02-27 22:47:33 +01:00
nodes_block_inspect.py Enhance LoRA loading and inspection capabilities by adding a merge function option for per-block strengths. Introduce block_strengths_debug output for improved integration with inspector nodes. Update relevant nodes to support this feature, ensuring compatibility with existing workflows. 2026-02-28 03:03:39 +01:00
nodes_blocks.py Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
nodes_blocks_merge.py Enhance LoRA loading and inspection capabilities by adding a merge function option for per-block strengths. Introduce block_strengths_debug output for improved integration with inspector nodes. Update relevant nodes to support this feature, ensuring compatibility with existing workflows. 2026-02-28 03:03:39 +01:00
nodes_blocks_scriptable.py Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
nodes_script_text.py Comment out scriptable block merge nodes (migrated to ComfyUI_Scriptable) 2026-04-17 23:24:45 +02:00
package-lock.json Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00
package.json Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00
README.md Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00
server_routes.py Add configuration loading and script serving functionality to WolfBypass. Implement a method to load configuration from a YAML file and environment variables to control scriptable node behavior. Enhance server routes to serve script assets, improving integration with the scriptable nodes. Update README and documentation to reflect new features and usage instructions. 2026-03-02 15:28:23 +01:00

ComfyUI_WolfBypass

Bypass LoRA loader with block chopping and per-block strength for Flux/Chroma and similar models.

Security

Scriptable nodes execute arbitrary Python. Only run scripts and workflows from trusted sources. See Scriptable Block Merge for details.


Table of Contents


Installation

Place this folder in your ComfyUI custom_nodes directory (or clone/link). Restart ComfyUI.

All node names end with (🐺) in the UI.


Node map

Nodes are grouped by family: filter (text pattern), block-strength (widget or script), img/txt split (Flux-style), and inspection.

flowchart TB
  subgraph filter [Block Filter]
    A1[Load LoRA Bypass Block Filter]
    A2[Load LoRA Bypass Block Filter Model Only]
  end
  subgraph bypass_blocks [Block Strength Bypass]
    B1[Load LoRA Bypass Per-Block Strength]
    B2[Load LoRA Bypass Per-Block Strength Model Only]
  end
  subgraph merge_blocks [Block Strength Merge]
    M1[Load LoRA Merge Per-Block Strength]
    M2[Load LoRA Merge Per-Block Strength Model Only]
  end
  subgraph scriptable [Scriptable]
    S1[Load LoRA Merge Per-Block Scriptable]
    S2[Load LoRA Img/Txt Separate Scriptable]
  end
  subgraph imgtxt [Img/Txt Separate]
    I1[Load LoRA Bypass Img/Txt Separate]
    I2[Load LoRA Merge Img/Txt Separate]
  end
  subgraph inspect [Inspection]
    D1[Block Strength Inspector]
    D2[Block Strength Plot]
  end
  MODEL[MODEL] --> A1
  MODEL --> B1
  MODEL --> M1
  MODEL --> S1
  MODEL --> I1
  A1 --> MODEL
  B1 --> block_strengths_debug
  M1 --> block_strengths_debug
  S1 --> block_strengths_debug
  I1 --> block_strengths_debug
  block_strengths_debug --> D1
  block_strengths_debug --> D2

Quick reference

Class Display name File Inputs Outputs
LoraLoaderBypassWolf Load LoRA (Bypass, Block Filter) (🐺) nodes.py model, clip, lora_name, strength_model, strength_clip; optional: block_filter, block_filter_mode, compile_forward MODEL, CLIP
LoraLoaderBypassWolfModelOnly Load LoRA (Bypass, Block Filter, Model Only) (🐺) nodes.py model, lora_name, strength_model; optional: block_filter, block_filter_mode, compile_forward MODEL
LoraLoaderBypassWolfBlocks Load LoRA (Bypass, Per-Block Strength) (🐺) nodes_blocks.py model, clip, lora_name, strength_model, strength_clip, block_strengths; optional: compile_forward MODEL, CLIP, block_strengths_debug
LoraLoaderBypassWolfBlocksModelOnly Load LoRA (Bypass, Per-Block Strength, Model Only) (🐺) nodes_blocks.py model, lora_name, strength_model, block_strengths; optional: compile_forward MODEL, block_strengths_debug
LoraLoaderBypassWolfBlocksDoubleSplit Load LoRA (Bypass, Img/Txt Separate Weights) (🐺) nodes_blocks.py same as Bypass Per-Block MODEL, CLIP, block_strengths_debug
LoraLoaderBypassWolfBlocksModelOnlyDoubleSplit Load LoRA (Bypass, Img/Txt Separate, Model Only) (🐺) nodes_blocks.py same as above, model-only MODEL, block_strengths_debug
LoraLoaderWolfBlocks Load LoRA (Merge, Per-Block Strength) (🐺) nodes_blocks_merge.py model, clip, lora_name, strength_model, strength_clip, block_strengths MODEL, CLIP, block_strengths_debug
LoraLoaderWolfBlocksModelOnly Load LoRA (Merge, Per-Block Strength, Model Only) (🐺) nodes_blocks_merge.py model, lora_name, strength_model, block_strengths MODEL, block_strengths_debug
LoraLoaderWolfBlocksDoubleSplit Load LoRA (Merge, Img/Txt Separate Weights) (🐺) nodes_blocks_merge.py same as Merge Per-Block MODEL, CLIP, block_strengths_debug
LoraLoaderWolfBlocksModelOnlyDoubleSplit Load LoRA (Merge, Img/Txt Separate, Model Only) (🐺) nodes_blocks_merge.py same, model-only MODEL, block_strengths_debug
LoraLoaderWolfBlocksScriptable Load LoRA (Merge, Per-Block, Scriptable) (🐺) nodes_blocks_scriptable.py model, lora_name, strength_model; optional: block_strengths, script MODEL, block_strengths_debug
LoraLoaderWolfBlocksScriptableDoubleSplit Load LoRA (Img/Txt Separate, Scriptable) (🐺) nodes_blocks_scriptable.py same + script for img/txt blocks MODEL, block_strengths_debug
BlockStrengthInspector Block Strength Inspector (🐺) nodes_block_inspect.py block_strengths_debug (required) block_strengths_txt (STRING)
BlockStrengthPlot Block Strength Plot (🐺) nodes_block_inspect.py block_strengths_debug (required); optional: width, height image (IMAGE)

Block filter nodes

  • Load LoRA (Bypass, Block Filter) (🐺)
    Applies LoRA in bypass mode with optional block filter: a single text pattern (e.g. double_blocks.0,double_blocks.1 or double_blocks.*) and include/exclude mode.

  • Load LoRA (Bypass, Block Filter, Model Only) (🐺)
    Same as above, model-only (no CLIP).

flowchart LR
  MODEL[MODEL] --> Bypass[Bypass + block_filter]
  CLIP[CLIP] --> Bypass
  Bypass --> MODEL
  Bypass --> CLIP

See Block filter syntax below for block_filter and block_filter_mode.


Block-strength nodes (Bypass / Merge)

  • Load LoRA (Bypass, Per-Block Strength) (🐺) and Model Only
    Bypass LoRA with per-block strength. The node scans the LoRA and shows a grid (D0, D1, …, S0, S1, …). Drag cells to set strength; stored as JSON.

  • Load LoRA (Merge, Per-Block Strength) (🐺) and Model Only
    Same widget and block order, but applies LoRA via standard merge (weights modified as in core Load LoRA). Per-block strengths scale the merge; CLIP uses a single strength.

When you switch LoRA, the block list updates automatically. Order: double_blocks then single_blocks (see Block strength format and API).


Scriptable block merge (model only)

  • Load LoRA (Merge, Per-Block, Scriptable) (🐺)
    Model-only. You provide a Python script that receives blocks, block_strengths, strength_model, lora_name, and must set output_strengths. Only the scripts output is applied; block_strengths input only seeds the script (and is used as fallback if the script fails).

  • Security: This node runs user Python. Do not load untrusted workflows or scripts.

Full contract, injected variables, and examples: Scriptable Block Merge. Strength profiles and copy-paste recipes: Custom Merge Recipes.


Img/Txt separate weights (Flux-family)

For Flux-style models, each double block has an image branch (img_attn, img_mlp) and text branch (txt_attn, txt_mlp). The “Img/Txt Separate” nodes expose two strengths per double block: one for the image branch, one for the text branch. The widget shows D0i, D0t, D1i, D1t, … then S0, S1, … (i = img, t = txt).

  • Load LoRA (Bypass, Img/Txt Separate Weights) (🐺) and Model Only
    Bypass with separate img/txt strengths per double block.

  • Load LoRA (Merge, Img/Txt Separate Weights) (🐺) and Model Only
    Standard merge with separate img/txt strengths.

  • Load LoRA (Img/Txt Separate, Scriptable) (🐺)
    Script receives blocks like double_blocks.0.img, double_blocks.0.txt, … and sets output_strengths. Can also set output_merge_function to change how the scaled delta is applied (see SCRIPTABLE_BLOCK_MERGE.md).

Use these when you want different LoRA strength on image vs text branches (e.g. stronger on img, weaker on txt).


Block strength inspection (debug / viz)

  • Block Strength Inspector (🐺)
    Prints block strength values (index, block name, value). Requires block_strengths_debug from any Load LoRA block node. Output: STRING.

  • Block Strength Plot (🐺)
    Plots block strengths as a bar chart (dark theme, PIL). Requires block_strengths_debug; optional width / height. Output: IMAGE.

flowchart LR
  LoadNode[Load LoRA block node] --> debug[block_strengths_debug]
  debug --> Inspector[Block Strength Inspector]
  debug --> Plot[Block Strength Plot]
  Inspector --> STRING[STRING]
  Plot --> IMAGE[IMAGE]

Connect block_strengths_debug from any Bypass/Merge/Scriptable block node to Inspector or Plot.


Block filter (original nodes)

  • block_filter: Comma-separated names or patterns, e.g. double_blocks.0, single_blocks.0-5, double_blocks.*.
  • block_filter_mode: include = only these blocks get the LoRA; exclude = all blocks except these.

Per-block strength (Blocks nodes)

  • block_strengths: JSON array of numbers, one per block (e.g. [1, 0.5, 1, ...]). Filled by the widget or wired from another node.
  • Widget: D / S with indices; on Img/Txt nodes: D0i, D0t, … Drag a cell up/down (02).

Configuration

Edit config.yaml in this folder (or set env vars) to change behavior:

  • disable_scriptable_nodes (default: false): If true, scriptable block merge nodes (those that run user Python) are not registered. Use in locked-down environments to disable remote code execution.
  • Env override: COMFYUI_WOLFBYPASS_DISABLE_SCRIPTABLE_NODES=1 forces scriptable nodes off.
flowchart LR
  subgraph sources [Config sources]
    YAML[config.yaml]
    ENV[COMFYUI_WOLFBYPASS_DISABLE_SCRIPTABLE_NODES]
  end
  subgraph init [__init__.py]
    load[_load_config]
    reg[Register nodes]
  end
  YAML --> load
  ENV --> load
  load --> reg
  reg -->|disable_scriptable_nodes: true| no_script[Scriptable nodes not registered]
  reg -->|false| yes_script[Scriptable nodes registered]

Build and debug

  • Minified scripts: By default the UI loads minified JS. To regenerate: npm install then npm run minify (writes web/scripts/*.min.js_).
  • Debug (unminified): In the browser console set localStorage.setItem("ComfyUI_WolfBypass_debug_scripts", "1") then reload the page to load unminified scripts.
  • CodeMirror bundle: After editing build/codemirror_entry.mjs, run npm run build:codemirror from this extension; it writes web/scripts/codemirror_bundle.js_. Script sources for the loader live in web/scripts/*.js_; run npm run minify after editing them.
  • Editor resize grip: Disabled by default (autoresize mode). Opt in only when needed: localStorage.setItem("ComfyUI_WolfBypass_enable_editor_resize_grip", "1") then reload.

Script and bundle load flow:

sequenceDiagram
  participant ComfyUI
  participant register as register_wolfbypass.js
  participant scripts as /extensions/.../scripts/
  participant Editor as python_script_editor
  participant Block as block_strength_editor

  ComfyUI->>register: load (only .js in web/)
  register->>scripts: GET codemirror_bundle.js
  scripts-->>register: codemirror_bundle.js_
  register->>scripts: GET python_script_editor[.min].js
  scripts-->>register: script
  register->>scripts: GET block_strength_editor[.min].js
  scripts-->>register: script
  Note over register: window.WolfCodeMirror set before Editor runs
  register->>Editor: execute
  register->>Block: execute

Documentation


Changelog

See CHANGELOG.md for version history and session summaries (e.g. CodeMirror, minify, config, script loading, editor resize).


Requirements

  • ComfyUI with bypass LoRA support (core or patched).
  • safetensors for LoRA scanning (block list from file keys only).
  • Block Strength Plot: uses PIL; no matplotlib required (placeholder if dependencies missing).

License

Same as your ComfyUI / project.