Eses Composition Golden Ratio
Compose with a Fibonacci spiral that never touches your pixels
- image
- mask
- image
- mask
A ruler, not a generator
Composition is the part of an image that text prompts just can't pin down. You can beg for a "centered subject" and the sampler puts a face in the corner anyway, because the prompt is a vibe, not a layout. Eses Composition Golden Ratio attacks that problem from the other end: it doesn't try to steer the model at all. It's a visual ruler - a golden-ratio (Fibonacci) spiral overlay drawn on top of your preview image so you can line up the subject, the horizon, the negative space before you ever commit to a seed.
Think of it as the grid on a camera's viewfinder, or the rule-of-thirds guide in a photo editor, except it's the phi-based 1:1.618 spiral that composition nerds actually argue about. If you're trying to reproduce a classic "golden ratio" crop - subject at the spiral's focal point, negative space sweeping along the curve - this is a much more precise reference than eyeballing it.
How it works (and the one thing to not get burned by)
The mechanism is split across two halves. On the Python side, the node takes your image, optionally downscales it to preview_resolution_limit, base64-encodes it, and pushes it to the browser over a websocket. The frontend JS then draws the golden rectangle division and spiral directly onto the node's canvas, applying your transforms and blend modes as it goes.
Which brings us to the trap: the image output is literally your input, unchanged. The spiral is preview-only, drawn in your browser. Wire the output into a Save node and the saved file has no spiral in it - by design, the README says so, and the source return (image, mask) confirms it. If you wanted the guide burned into an export, this node won't do that for you; you'd screenshot the preview. For composition guidance that's the right call, but plenty of beginners will plug this in, save, and wonder where the golden ratio went.
The inputs that matter
There are a lot of knobs, but you'll actually touch a handful:
- image - any IMAGE tensor. Feed it whatever you're composing.
- preview_resolution_limit (default 1024) - the max dimension of the preview sent to the browser. It only affects preview sharpness, never the output; a 4K source at the default will look soft under the guide while the real output stays full-res.
- steps (default 8) - how many recursive divisions of the golden rectangle to draw. More steps, finer grid.
- orientation (default
auto) - starting direction of the spiral; auto picks right for landscape, up for portrait. - fit_mode (
crop/stretch) - crop keeps the true golden ratio and may leave empty space; stretch squashes the pattern to your image's aspect ratio. - line_color_rgb - an RGBA string like
"255,255,255,255". - The transform gang: offset_x/y, rotation, scale, flip_horizontal/vertical, axial_stretch, plus blend_mode with 17 canvas blend modes if you want the guide to sit under or interact with the preview.
There's also an optional mask input, which passes straight through to the mask output. Don't expect it to constrain the guide - it doesn't.
Install
One of the easiest installs in an ecosystem famous for dependency hell:
cd ComfyUI/custom_nodes
git clone https://github.com/quasiblob/EsesCompositionGoldenRatio.git
Restart ComfyUI and it shows up under Eses Nodes/Visualization. Or use ComfyUI Manager and search "EsesCompositionGoldenRatio". There's no requirements.txt and no model download - it only needs torch and Pillow, which ComfyUI already ships. That's the whole setup.
Gotchas worth knowing
The overlay is frontend-only: it's drawn by a JS file in the web/ directory. Headless/API runs or non-standard frontends get the passthrough image and no spiral. Also note it's a ruler best suited to near-1:1.618 frames - in crop mode it logs a console warning when your image's aspect is far off the golden ratio, which is just the node telling you it's working against you. A version 1.0.1 fix already sorted an issue where the overlay stayed visible when the node was collapsed, so keep it updated. Finally, the pack ships a custom "My ComfyUI Nodes License": free for personal use, but no rebranding, code reuse, or bundling, and it's meant to be distributed only from the original repo - install it from GitHub or Manager, not a random download site.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| preview_resolution_limit | INT | 1024256–8192 | — |
| line_color_rgb | STRING | 255,255,255,255 | — |
| line_thickness | FLOAT | 1.50.1–32 | — |
| uniform_line_width | BOOLEAN | false | — |
| blend_mode | COMBO | 17 options: source-over, lighter, screen, multiply, overlay, darken, +11 | |
| orientation | COMBO | 5 options: auto, up, down, left, right | |
| fit_mode | COMBO | crop | 2 options: crop, stretch |
| crop_offset | FLOAT | 0.500–1 | — |
| flip_horizontal | BOOLEAN | false | — |
| flip_vertical | BOOLEAN | false | — |
| draw_spiral | BOOLEAN | true | — |
| steps | INT | 81–20 | — |
| axial_stretch | FLOAT | 1.000.1–4 | — |
| offset_x | FLOAT | 0-4096–4096 | — |
| offset_y | FLOAT | 0-4096–4096 | — |
| rotation | FLOAT | 0.0-360–360 | — |
| scale | FLOAT | 1.000.1–5 | — |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |