Nodes/Eric Qwen-Edit & Qwen-Image Nodes/Eric Qwen Direction Average From Folder
ComfyUI Node

Eric Qwen Direction Average From Folder

Turn a folder of Qwen direction pairs into one debiased, library-ready direction

By EricRollei·Created 6 months ago·Updated 4 months ago· 20
Eric Qwen Direction Average From Folder
    • direction
    folder
    prefix
    normalizetrue
    target_rms2.0
    save_as
    save_as_bf16false

    The bulk version of Direction Average, and the primary tool the docs point at for building a direction library. Where Direction Average handles 2–4 live directions, Direction Average From Folder sweeps up every saved direction file in a directory, averages them, normalizes the result, and hands you one clean direction - or saves it straight to your library.

    This is the "14 pairs of Silvermax conversions" workflow in a single node. You save each pair's direction as silvermax/01, silvermax/02, …, then point this node at the silvermax folder and get silvermax_final back.

    The inputs

    • folder - the dropdown. It lists subfolders of models/qwen_directions/ and refreshes on every run. The (root folder) option averages everything in the top level.
    • prefix - optional filename filter, for averaging only prefix_* files inside a folder.
    • normalize - on by default here (unlike the 2–4 node). Averaging shrinks magnitude, so rescaling is the sane default.
    • target_rms - default 2.0. The rescale target: 1.0 unit, 2.0 moderate, 3.5 ≈ original single-pair strength.
    • save_as - optional filename to persist the averaged result right there (subfolders supported, same as Direction Save).
    • save_as_bf16 - halve the saved file size.

    Output is the averaged direction.

    The console numbers that tell you it worked

    This is one node where the console output is genuinely informative:

    [EricQwenDir]   mean individual rms=3.8320
    [EricQwenDir] averaged 14 directions | rms=1.0625
    [EricQwenDir] normalized: rms 1.0625 → 2.00 (scale=1.883)
    

    The ratio of averaged RMS to mean pair RMS is your purity measure. 1.06 / 3.83 = 28% - high purity, meaning most of the magnitude was image-specific and cancelled. If the ratio comes out near 1.0, your pairs weren't diverse enough and you're averaging near-identical directions.

    The library-building pattern

    # 14 pairs: encode color ↔ B&W, compute + save each
    Direction Average From Folder(folder="silvermax", normalize=True, target_rms=2.0, save_as="silvermax_final")
    Direction Load("silvermax_final") → Direction Apply(base_cond, scale=1.0) → Conditioned Edit
    

    Diversity guidance from the docs: mix skin tones, hair colors, lighting, backgrounds, focal distances - every covered dimension is one that won't dominate the average.

    Installing it

    ComfyUI Manager → "Eric Qwen-Edit", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EricRollei/Eric_Qwen_Edit_Experiments.git
    

    Restart. Loading saved direction files needs no model; the full graph needs a Qwen-Image-Edit pipeline via the pack's loader (Qwen/Qwen-Image-Edit-2511, ~54 GB).

    Gotchas

    • Empty folder in the dropdown? You haven't saved anything into that path, or the files are elsewhere - it only scans models/qwen_directions/.
    • Zero-pad your filenames. 01, 02, ... 10 sorts correctly; 1, 2, ... 10 puts 10 next to 1. The docs flag this for a reason.
    • Purity ratio near 1 = wasted run. Rebuild the pairs with more diverse images rather than trusting the average.
    CategoryEric Qwen-Edit/Conditioning/Directions

    Inputs (6)

    NameTypeDefaultDescription
    folderCOMBOSubfolder of models/qwen_directions/. Refreshes on every run.
    prefixoptSTRING
    normalizeoptBOOLEANtrue
    target_rmsoptFLOAT2.00.1–10
    save_asoptSTRING
    save_as_bf16optBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    directionQWEN_DIRECTION