Nodes/ꘇ Genereti/ꘇ top.crop
ComfyUI Node

ꘇ top.crop

Normalized crop that stretches back to full size — a zoom, not a trim

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ top.crop
  • image
  • image
◄left0.00►
◄top0.00►
◄right1.00►
◄bottom1.00►

The name says crop, but read the description carefully before you wire it: top.crop takes a normalized rectangle of the source and stretches it back to the original texture resolution. It is a region zoom, not a trim. Four fractions in, same pixel dimensions out.

That's actually the behaviour you want most of the time in a texture chain - you're isolating a face, a corner of a screen, a region of a noise field so the next operator sees it big - and it's the detail that trips people who expect the output to get smaller. It also means top.crop is the cheapest way to zoom into a part of a live feedback or noise field without touching the sampler.

How it works

left, top, right, bottom are all normalized 0..1, so the defaults (0, 0, 1, 1) are the whole image. The node remaps normalized UVs so that the selected rectangle fills the output, sampling with clamp-to-edge and premultiplied interpolation - the same fringe-safe sampling the rest of the pack uses, so transparent edges don't pick up black.

Because the rectangle is stretched to the existing resolution rather than a new one, cropping a wide, short strip (say left 0, right 1, top 0.4, bottom 0.6) squashes then re-stretches and gives you a letterboxed, vertically magnified result. It will not preserve your aspect ratio for you.

Right must exceed left, and bottom must exceed top. Invert them and the node raises an error instead of silently producing an empty image.

The inputs that matter

Just the four floats. The useful pattern is a crop → process → composite-back loop: crop into a region, run top.level or top.edge or top.convolve on it, then top.composite it over the full frame with a feathered top.mask. Same idea as a regional re-render, minus the re-render.

Output: one image, same dimensions as the input.

Install

ComfyUI Manager → search ꘇ Genereti → install, or:

git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

Restart, refresh the browser page. The whole pack's requirements file is one frontend pin (comfyui-frontend-package>=1.53.6); torch, NumPy and Pillow come from ComfyUI itself. Nothing to download. The node is ꘇ top.crop under Genereti / TOP, and the leading glyph sorts badly, so search genereti.

Traps

Aspect ratio is your problem. The output is always the source's W×H. Want a true 1:1 crop? Do that in top.cleanup (which takes explicit width/height) or a resize node; this one is for region isolation.

No batch awareness. It applies the same rectangle to every image in the batch - there's no "first image only" mode. If you're processing a batch of shots, this is one rectangle for all of them.

It's not an inpainting helper. Stretching a region back to full size and then sampling it is a different thing from an inpaint mask. If you want a masked region re-generated, use a proper inpaint node and keep this for texture work.

Live vs Queue. Live mode keeps the chain on the browser GPU; Queue runs the PyTorch path. Live intermediates are 8-bit and Queue is float, so a heavy crop-then-zoom can look marginally different between the preview and the render.

Pack status: super-alpha, classroom testing. Back up your workflows.

CategoryGenereti / TOP

Inputs (5)

NameTypeDefaultDescription
imageIMAGE—
leftFLOAT0.000–1—
topFLOAT0.000–1—
rightFLOAT1.000–1—
bottomFLOAT1.000–1—

Outputs (1)

NameTypeDescription
imageIMAGE—