Flex Image Tilt Shift β‘π ‘π π £π
The miniature-model camera effect, reactive
- images
- opt_feature
- IMAGE
Tilt-shift is the effect that makes real scenes look like miniature models - a thin sliver of the frame stays sharp while everything else goes soft, mimicking the shallow depth of field you'd get from an actual macro/tilt-shift lens shooting a tiny scene. This is the most parameter-dense of RyanOnTheInside's image effects nodes, with real control over the focus region's shape and the character of the out-of-focus blur (bokeh) - and, being a Flex node, any of it can be driven by a reactive Feature.
How it works
The focus area is defined by focus_position_x/focus_position_y (0β1, where it's centered) and focus_width/focus_height (how large the sharp region is, relative to the frame). focus_shape decides how that region's edge behaves: rectangle for a hard-edged sharp band, ellipse for a soft oval, or gradient (the default) for a continuous falloff that reads as the most naturalistic depth simulation of the three. Everything outside that focus area gets blurred by blur_amount (0β50).
The out-of-focus character comes from the bokeh settings: bokeh_shape - circular (natural, modern-lens look), hexagonal (vintage-lens aperture blades), or star (deliberately decorative) - plus bokeh_size and bokeh_brightness, which control how prominent the bright, blurred highlight blobs are in the out-of-focus regions. chromatic_aberration adds a touch of color fringing specifically in the blurred areas, which is a small but real detail real macro lenses actually exhibit.
feature_param can drive any one of nine settings: blur_amount, focus_position_x/y, focus_width/height, bokeh_size, bokeh_brightness, chromatic_aberration, or None. A genuinely useful reactive pattern here is animating focus_position_x/y so the "in focus" point tracks something over time - a slow rack-focus effect - rather than only pumping blur intensity up and down.
Inputs and outputs that matter
images- required.focus_position_x/yandfocus_width/height- set where and how large the sharp area is; get this right first, it defines the whole composition of the effect.blur_amount- the second thing to tune once focus placement looks right.focus_shape/bokeh_shape- worth trying a few combinations;gradient+circularis the most photographically "correct" pairing, butrectangle+starreads as much more stylized/toylike.
Output is a single IMAGE.
How to install it
Via ComfyUI Manager, search "RyanOnTheInside." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
then restart. No model download needed - it's an image-processing effect, not a diffusion model.
Common issues & troubleshooting
Effect doesn't read as "miniature" at all, just blurry. Tilt-shift's illusion depends heavily on the focus band being thin relative to the frame - a wide focus_width/focus_height just looks like a normal soft vignette-blur, not the miniature effect. Keep the focus region genuinely narrow, and place it low in the frame (matching where a real tilt-shift lens's plane of focus tends to fall on landscape/cityscape shots) for the classic look.
Bokeh highlights aren't visible even with bokeh_size cranked up. Bokeh only shows up meaningfully where the source image actually has bright, small highlights in the blurred region - string lights, specular reflections, sun through leaves. A flat, evenly-lit source image simply doesn't have anything for the bokeh shape to render around, regardless of settings.
Reactive focus_position drifts unnaturally. If a feature is driving focus_position_x/y in absolute mode and the feature is noisy, the focus point can jitter rather than sweep smoothly. Switch to relative mode or smooth the upstream feature if you want the rack-focus effect to feel deliberate rather than twitchy.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| strength | FLOAT | 1.000β1 | Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle. |
| feature_threshold | FLOAT | 0.000β1 | Minimum feature value to trigger the effect (0.0 to 1.0) Only applies the effect when the feature value exceeds this threshold. Lower values make the effect more sensitive, higher values make it more selective. |
| feature_param | COMBO | Choose which parameter to modulate: - blur_amount: Dynamically adjust blur intensity - focus_position_x: Dynamically adjust horizontal focus - focus_position_y: Dynamically adjust vertical focus - focus_width: Dynamically adjust focus area width - focus_height: Dynamically adjust focus area height - bokeh_size: Dynamically adjust bokeh highlight size - bokeh_brightness: Dynamically adjust bokeh intensity - chromatic_aberration: Dynamically adjust color fringing - None: No parameter modulation | |
| feature_mode | COMBO | relative | How to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum |
| images | IMAGE | Input image sequence to be processed (IMAGE type) | |
| blur_amount | FLOAT | 10.00β50 | Amount of blur applied to out-of-focus areas. Higher values create stronger depth-of-field effect (0.0 to 50.0) |
| focus_position_x | FLOAT | 0.500β1 | Horizontal position of focus center. 0 = left edge, 1 = right edge (0.0 to 1.0) |
| focus_position_y | FLOAT | 0.500β1 | Vertical position of focus center. 0 = top edge, 1 = bottom edge (0.0 to 1.0) |
| focus_width | FLOAT | 0.200β1 | Width of the in-focus area relative to image width. Larger values keep more of the image sharp (0.0 to 1.0) |
| focus_height | FLOAT | 0.200β1 | Height of the in-focus area relative to image height. Larger values keep more of the image sharp (0.0 to 1.0) |
| focus_shape | COMBO | gradient | Shape of the focus area: - rectangle: Sharp-edged focus region with clear boundaries - ellipse: Smooth oval focus region for natural transitions - gradient: Continuous focus falloff for realistic depth simulation |
| bokeh_shape | COMBO | circular | Shape of out-of-focus highlights: - circular: Natural, round bokeh like modern lenses - hexagonal: Six-sided bokeh typical of vintage lenses - star: Decorative star-shaped bokeh for artistic effect |
| bokeh_size | FLOAT | 0.50.1β2 | Size of bokeh highlights in out-of-focus areas. Larger values create more pronounced bokeh effects (0.1 to 2.0) |
| bokeh_brightness | FLOAT | 1.20.5β2 | Brightness multiplier for bokeh highlights. Higher values make bright points more prominent (0.5 to 2.0) |
| chromatic_aberration | FLOAT | 0.000β1 | Amount of color fringing in out-of-focus areas. Simulates lens dispersion effects (0.0 to 1.0) |
| opt_featureopt | FEATURE | Optional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |