LatentOperationSharpen_motorway_edition
Sharpen inside the latent, at sampling time, not after
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
This one is a bit different from the other latent nodes, so pay attention: LatentOperationSharpen_motorway_edition does not output a sharpened latent. It outputs a latent operation - a description of "sharpen me like this" that gets applied during sampling, when you wire it into a sampler's latent_operation input. Sharpening in latent space mid-sampling behaves differently from slapping a sharpen filter on the finished pixels, and it's a genuinely newer idea in ComfyUI (these operation nodes are still marked experimental in core).
It's the "unsharp mask in the latent" family: sharpen_radius sets the kernel size, sigma the blur of the mask, and alpha how strongly the sharpening is applied. The core implementation normalizes the latent, applies a gaussian-based high-pass kernel, and scales it by alpha. Start with the defaults (radius 9, sigma 1.0, alpha 0.1) and treat alpha as the "how much" knob - small values, it's a subtle crispness; crank it and you're chasing oversharpened halos.
Where this shines is a workflow that knows its output tends to come out soft - some checkpoints and samplers just do. Doing it in-latent means the sampler works with the sharpened signal for the whole denoise, rather than trying to fix a blurry result at the end.
The wrapper, and one quirk
Because the core node has no tensor inputs - only widget parameters - the wrapper differs from the pipe-clone norm:
sharpen_radius(INT, 1–31, default 9)sigma(FLOAT, 0.1–10, default 1.0)alpha(FLOAT, 0–5, default 0.1)OUTPUT_LATENT_OPERATION_key(defaultLATENT_OPERATION) - where the operation lands in the pipe.MOTORWAY 🚌💨- marked optional here, but in practice connect it anyway: the wrapper still needs a pipe to store the result under the output key, and the error you get without one is unhelpful.
The LATENT_OPERATION key is then read back by a sampler that supports it (in core, KSamplerAdvanced gained a latent_operation input for exactly this), which pulls the operation out of the pipe, applies it to the latent during the denoise loop, and produces your sharper image.
Installing
Part of the Motorway pack:
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
# restart ComfyUI
Or ComfyUI Manager → search ComfyUI_agilly1989_motorway → Install. No model downloads, no extra pip deps.
Gotchas
- The operation only does something if a downstream sampler actually consumes the
LATENT_OPERATIONkey. If you don't have one wired to read it, this node silently does nothing. - Need a
MotorwayStartupstream to have a pipe at all. - Keys are exact strings; a
Key: 'LATENT_OPERATION' doesn't exist in motorwayerror means nothing wrote that key before the sampler read it. - It's an experimental core feature wrapped by a beta pack - the author's README says "IF THINGS BREAK ITS BECAUSE I BROKE IT." If the node's missing from the menu, that's the beta, and latent operations are exactly the sort of bleeding-edge feature that gets toggled during refactors.
Sharpening is a subtle tool. Start tiny, trust your eyes, and don't expect it to rescue a fundamentally soft generation.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| sharpen_radius | INT | 91–31 | — |
| sigma | FLOAT | 1.00.1–10 | — |
| alpha | FLOAT | 0.100–5 | — |
| OUTPUT_LATENT_OPERATION_key | STRING | LATENT_OPERATION | — |
| MOTORWAY 🚌💨opt | MOTORWAY 🚌💨 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |