Nodes/lf-nodes/Tilt Shift
ComfyUI Node

Tilt Shift

Turn your renders into a model-train set

By lucafoscili·Created 2 years ago·Updated 6 days ago· 35
Tilt Shift
  • image
  • ui_widget
  • image
  • image_list
focus_position0.50
focus_size0.25
blur_radius25
feathersmooth
orientationhorizontal

Every so often someone posts an aerial photo of a city that looks like a meticulously built miniature - cars like toys, buildings like dollhouses. That's tilt-shift photography (or a convincing fake of it), and LF_TiltShift does the fake for you: it keeps a thin band of the image sharp and throws a heavy blur over everything else, which is exactly the cue that makes a scene read as "small." It's the miniature-ifier from the lf-nodes filter family, and it's a fun node - but it's also a genuinely useful attention-guiding tool once you stop thinking of it as a party trick.

How it works

It builds a distance map over the image - how far each pixel is from your chosen focus band - and converts that distance into a mask. Pixels inside the band are sharp; pixels outside get a Gaussian blur; the mask controls the blend between the two. Three details make or break the effect:

  • focus_position (FLOAT, 0–1, default 0.5) - vertical center of the sharp band. 0 is the top of the frame, 1 is the bottom.
  • focus_size (FLOAT, 0.05–0.9, default 0.25) - how tall the sharp zone is, as a fraction of the image.
  • blur_radius (INT, 3–151, default 25) - the Gaussian radius on the out-of-focus areas. Bigger = more "toy camera."
  • feather (linear / smooth / expo) - the fall-off curve of blur vs. distance. smooth is a smoothstep (gentle, the default); expo squares the mask for a tighter, more dramatic fall-off.

The optional orientation input is where it gets interesting: horizontal (the classic band across the middle), vertical (a vertical sharp stripe), or circular (a spot-focus). Circular mode is basically a poor-man's radial blur - blur the edges, keep the center - which is handy for vignetting-style focus pulls.

The inputs that matter

The band of sharpness is defined by focus_position and focus_size; blur_radius and feather define the blur and its edge. That's the whole recipe. The default 0.5 / 0.25 / 25 / smooth is a fine starting point for the classic overhead miniature shot.

Outputs are image and image_list, like the rest of the pack's filters.

Install

Part of lf-nodes:

  • ComfyUI Manager: search "LF Nodes", install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes.git, restart.

No models. OpenCV does the blur, and ComfyUI already ships it.

Common issues

  • The miniature effect looks fake. It always does on the wrong subject. The trick reads best on high-angle, detail-dense scenes - cityscapes, fields, traffic from above - where the compressed depth sells the illusion. A face-on portrait with a blur band just looks like a misfocused photo.
  • Blur radius too small = "what was the point?" 25 is a strong starting blur; below 10 the out-of-focus areas barely read as out of focus. This is one node where the defaults are worth keeping.
  • Hard edges on the sharp band. That's a too-small focus_size with a linear feather. Widen the band and use smooth for a gentler transition.
  • The before/after slider - the node's optional LF_COMPARE widget lets you slide between original and result while you tune, which is the fastest way to learn what each knob does.
Category✨ LF Nodes/Filters

Inputs (7)

NameTypeDefaultDescription
imageIMAGEImage to miniature-ify.
focus_positionFLOAT0.500–1Vertical centre of sharp band (0 = top, 1 = bottom).
focus_sizeFLOAT0.250.05–0.9Height of sharp zone as fraction of image.
blur_radiusINT253–151Gaussian radius for out-of-focus areas.
featherCOMBOsmoothFall-off curve of blur vs distance.
orientationoptCOMBOhorizontalDirection of the focus band.
ui_widgetoptLF_COMPARE[object Object]

Outputs (2)

NameTypeDescription
imageIMAGEImage tensor with tilt-shift effect applied.
image_listIMAGEList of image tensors with tilt-shift effect applied.