Nodes/KarmaNodes/Karma Before/After
ComfyUI Node

Karma Before/After

Publish-ready comparisons without leaving ComfyUI

By KarmaSwint·Created about a year ago·Updated 5 months ago· 1
Karma Before/After
  • before_image
  • after_image
  • comparison
modesplit_horizontal
split_position0.50
divider_width3
divider_colorwhite
show_labelsnone
label_sizemedium
gap_width4
background_colorblack
resize_modematch_before
before_labelBefore
after_labelAfter

You've graded an image, added grain, given it a film look - and now you want to show someone what the post-processing actually did. The unglamorous truth is that the last mile of image work is often making the comparison shot: lining up two renders side by side in an editor, adding labels, exporting. Karma Before/After automates exactly that. It takes a before_image and an after_image, and renders them into a single composite image in one of four layout modes, ready to save and post. No Photoshop, no canvas work.

The four modes cover the ways people actually present comparisons. side_by_side puts the images next to each other with an optional gap and background fill. split_horizontal and split_vertical are the slider-style splits - before on one side, after on the other, divided by a visible divider line with small triangular indicators at the edges (the polished "drag me" look, minus the dragging). blend is an opacity crossfade between the two. Whatever mode you pick, the output is one flat comparison IMAGE - which is the key thing to understand about this node: it's a renderer, not an interactive overlay. The split is baked in. If you want to slide a divider around live in the canvas, that's rgthree's Image Comparer job; this node exists so you can export something publication-ready.

Under the hood it's straightforward and forgiving: both images get resized to matching dimensions using Lanczos (that's what resize_mode controls - match_before is the default and the safest when sizes differ, or pick match_after, match_larger, match_smaller), then composited per the mode with the divider, gap, and labels drawn on top. All the presentation controls are there: split_position (0.0–1.0) moves the split or blend point, divider_width (0 hides it entirely), divider_color, show_labels (none/simple/outlined - outlined renders white text with a dark outline so it stays readable over anything), label_size, gap_width, background_color, and optional custom before_label/after_label strings.

Installing it

Search "KarmaNodes" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/KarmaSwint/ComfyUI-KarmaNodes
cd ComfyUI-KarmaNodes
pip install -r requirements.txt

Restart ComfyUI. No models, no weights - pure PIL.

Getting a good comparison

Wire your raw generation (or the pre-grade version) into before_image and your finished post-processed result into after_image, then save the output. A few tips from the README that hold up: blend mode is genuinely the best for spotting subtle differences - set split_position to 0, and each incremental change crossfades between the two versions so a slight tone shift becomes obvious. If you want to show the difference rather than spot it, split_horizontal with show_labels = outlined and a 2–3px red divider is the most readable combination. When the two inputs are different sizes, leave resize_mode on match_before unless you have a reason - it's the least surprising.

This is a utility node, and it knows it. It doesn't generate, it doesn't grade, it just closes the loop on the workflow by making your result presentable. For anyone posting comparisons of post-processing chains, upscale results, or model A/B tests, that's a genuine timesaver - and it rounds out this pack's post-processing suite the way the README's example pipeline suggests: generate, grade with Kolors/Tone Curves, add character with Lens FX and grain, then show your work with this.

CategoryKarmaNodes/Post-Processing

Inputs (13)

NameTypeDefaultDescription
before_imageIMAGEThe 'before' image (left/top in comparisons)
after_imageIMAGEThe 'after' image (right/bottom in comparisons)
modeCOMBOsplit_horizontalComparison layout mode
split_positionFLOAT0.500–1Position of the split/blend point (0.0 = all before, 1.0 = all after)
divider_widthINT30–20Width of the divider line in pixels (0 = no divider)
divider_colorCOMBOwhiteColor of the split divider line
show_labelsCOMBOnoneLabel style: none, simple text, or outlined text for visibility
label_sizeCOMBOmediumSize of the before/after labels
gap_widthINT40–100Gap between images in side-by-side mode (pixels)
background_colorCOMBOblackBackground/gap color
resize_modeCOMBOmatch_beforeHow to handle mismatched image sizes
before_labeloptSTRINGBeforeCustom label for the before image
after_labeloptSTRINGAfterCustom label for the after image

Outputs (1)

NameTypeDescription
comparisonIMAGE