ComfyUI Node Runs on cloud

advPlot merge

Combine two generated axes into one plot without retyping

By TinyTerraΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 605
advPlot merge
    • plot_text
    β—„label_typeValuesβ–Ί
    β—„plot_text1β€”β–Ί
    β—„plot_text2β€”β–Ί

    advPlot merge is the glue node for tinyterra's plot generators: it takes the output of two generators - say one range axis and one string axis - and merges them into a single plot_text you can feed into the advanced xyPlot. It's the node that lets you build a real multi-axis grid out of pieces instead of hand-assembling the syntax.

    Each generator node (range, string, combo) produces one axis: a numbered <1:v_label> line plus its [nodeid:widget='value'] entries. A proper XY plot wants an X axis and a Y axis, and while you can run two generators and copy-paste their text into the main node's x_plot and y_plot boxes, merge is for when you want that assembled programmatically - or when you're combining more than one generator per axis (a range plus a string, say) and need them merged into a single axis block.

    How it works

    It takes plot_text1 and plot_text2 (both optional wired STRING inputs) and merges them axis-by-axis by line number. The mechanism is a straight splice: for each axis number present in either input, it emits the axis header plus that axis's value lines from whichever input(s) contain it. The result is a single plot_text STRING with renumbered axes, ready for the advanced xyPlot's x_plot / y_plot / z_plot.

    label_type (Values / Title and Values / ID, Title and Values) sets the label style for the merged output, applied uniformly - so if your two sources used different label styles, the merge normalizes them to whatever you pick here.

    Output: plot_text, the merged STRING. Unlike the other generators it's not an output node, so it doesn't render its own UI display - wire it into the xyPlot and check there.

    Installing it

    Part of tinyterraNodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes.git
    

    or ComfyUI Manager β†’ tinyterraNodes. No extra dependencies.

    Gotchas

    The renumbering is where it gets you: the merge renumbers by position, not by your original axis numbers, so if the two inputs both contained an axis 1, the merged output has axis 1 and axis 2 in sequence - which is the point, but it means the axis numbers in the final text no longer match the source generators' numbering. Also, because it's a line-number splice, if the two inputs have wildly different axis lengths, the shorter one's values just don't appear for axes the other doesn't have - no error, just a shorter plot. If you're only merging to hand a combined axis to the main node, you could equally paste the two generator outputs into one x_plot box by hand; merge earns its keep when you want it done on every graph run without copy-paste.

    Category🌏 tinyterra/xyPlot

    Inputs (3)

    NameTypeDefaultDescription
    label_typeCOMBOValues3 options: Values, Title and Values, ID, Title and Values
    plot_text1optSTRINGβ€”
    plot_text2optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    plot_textSTRINGβ€”