Karma Before/After
Publish-ready comparisons without leaving ComfyUI
- before_image
- after_image
- comparison
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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| before_image | IMAGE | The 'before' image (left/top in comparisons) | |
| after_image | IMAGE | The 'after' image (right/bottom in comparisons) | |
| mode | COMBO | split_horizontal | Comparison layout mode |
| split_position | FLOAT | 0.500–1 | Position of the split/blend point (0.0 = all before, 1.0 = all after) |
| divider_width | INT | 30–20 | Width of the divider line in pixels (0 = no divider) |
| divider_color | COMBO | white | Color of the split divider line |
| show_labels | COMBO | none | Label style: none, simple text, or outlined text for visibility |
| label_size | COMBO | medium | Size of the before/after labels |
| gap_width | INT | 40–100 | Gap between images in side-by-side mode (pixels) |
| background_color | COMBO | black | Background/gap color |
| resize_mode | COMBO | match_before | How to handle mismatched image sizes |
| before_labelopt | STRING | Before | Custom label for the before image |
| after_labelopt | STRING | After | Custom label for the after image |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| comparison | IMAGE | — |