Nodes/ComfyUI-ZML-Image/ZML_模糊锐化脚本
ComfyUI Node

ZML_模糊锐化脚本

Blur or sharpen in the middle of sampling, not after

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_模糊锐化脚本
  • 上一个脚本
  • 脚本
触发时机0.2
模式
强度1.0

Most sharpening happens after the image exists - a post-process pass on the finished frame. ZML_BlurSharpenScriptNode (ZML_模糊锐化脚本) does it during the diffusion process: it's a script node that rides along with this pack's samplers and applies blur or sharpening at a point you choose in the sampling timeline. Same pixel operation, different moment - and the timing is the whole point.

What it is

Part of a family of "script" nodes the pack author added for its own samplers (alongside dynamic CFG, extra noise, brightness/contrast, vignette). Script nodes don't touch pixels directly - they build a description of effects, and the pack's KSampler executes them mid-sampling. The inputs:

  • 触发时机 (FLOAT, 0–1, default 0.2) - when in the sampling run the effect applies. 0 is the start, 1 is the end. The author's own test figures show these tuned mid-run: blur early to soften the noisy start, sharpen late to firm up the details.
  • 模式 - 模糊 (blur) or 锐化 (sharpen).
  • 强度 (FLOAT, 0–10) - and here the tooltip is the ground truth: in blur mode it's the blur radius (sigma); in sharpen mode it's the sharpening strength factor.
  • 上一个脚本 (ZML_SCRIPT, optional) - chain scripts together.

Output is a single 脚本 (ZML_SCRIPT) - the accumulated list of effects, sorted by their trigger times - which you feed to the pack's sampler node.

How it works

Each script node appends a small dictionary - {type, timing, mode, strength} - to a list it inherits from 上一个脚本, then sorts the whole list by timing. That sorted list is what the ZML sampler walks during the sampling loop, applying each effect at its fraction of the run. So "blur at 0.2, sharpen at 0.8" becomes a single script the sampler respects, instead of you trying to do it manually at the end. The distinction from plain post-processing matters: applying blur mid-sampling isn't the same as blurring the finished image, because there's still denoising left to do afterward.

Install and gotchas

Pack install first:

cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image

or ComfyUI Manager → ComfyUI-ZML-Image, restart. Nothing extra.

The big gotcha, and it's a real one: this script only does anything when used with the pack's own sampler. The output type is ZML_SCRIPT, a pack-private type - it won't plug into the stock KSampler or Efficiency's. If you're not already using a ZML sampler, this node is a dead end, and the README's story of the sampler family (borrowing seed and preview tricks from Efficiency and others) is the reason the pack has its own. The honest take: mid-sampling blur/sharpen is a niche effect - for most people, the same blur or unsharp-mask applied after the fact in a post-processing node gives you 95% of the value with none of the workflow lock-in. Try it because the timing genuinely changes results on some noisy checkpoints, but don't rebuild your whole graph around it. Chinese-first UI, English patch at github.com/zml-w/ZZZ_ZML_English_Patch, one-person pack, no English community - GitHub issues if it misbehaves.

Categoryimage/ZML_图像/采样器相关

Inputs (4)

NameTypeDefaultDescription
触发时机FLOAT0.20–1
模式COMBO2 options: 模糊, 锐化
强度FLOAT1.00–10模糊模式下代表模糊半径(Sigma),锐化模式下代表锐化强度因子
上一个脚本optZML_SCRIPT

Outputs (1)

NameTypeDescription
脚本ZML_SCRIPT