Rikan RTX Resolution Settings
Sized-up width and height, ready for a latent
- pixels
- width
- height
This is a tiny utility, so let's be quick about what it's actually for. You feed it an image and pick a target resolution class, and it hands back a width and height pair: the image scaled up to that class's long edge, aspect ratio preserved, and rounded down to a multiple of 8. That's it. No sampling, no latent, no magic - just the two numbers a KSampler's EmptyLatent is begging you to have.
Sound trivial? It's the kind of trivial that quietly solves a real annoyance. ComfyUI's latent space has hard rules - dimensions need to divide cleanly by 8 (and more for some video models), and if you're chaining a generated image into an img2img or an upscale pass, keeping the target resolution in sync with your actual input's aspect ratio is a manual calculation you will absolutely get wrong at 2am. The node does the division-and-rounding for you, and it does it based on the real pixel dimensions of whatever you wire in, so a portrait image stays portrait, a landscape stays landscape.
Inputs and outputs
Only two inputs. pixels is your source image. target_resolution is a dropdown: 1080p (FHD), 2K (QHD), 4K (UHD), or 8K (FUHD). Each maps to a long-edge target - 1920, 2560, 3840, 7680 respectively. The node reads the first frame's orientation, computes the short edge to match, and clamps both to multiples of 8. Outputs: width and height, both INT, ready to plug into EmptyLatentImage or the size slot of just about anything.
About the name: there is nothing RTX-specific or even GPU-specific here. It's pure arithmetic on an image tensor. "Rikan RTX Resolution Settings" is branding; the node runs identically on an AMD card or in CPU-only mode. Don't read anything into it.
Where it fits
The natural wiring is: Load Image → this node → EmptyLatentImage → KSampler. That keeps your generated canvas exactly proportional to your source. Pair it with the pack's Qwen Custom Image Size node if you want a full resize-plus-prompt prep - that one does the actual upscale/outpaint work and produces the latent itself, whereas this one only computes dimensions and stays out of the pixel business. If all you need is "give me numbers that match my input," this is the lighter tool.
Caveats and install
- It reads the first frame of the input batch for orientation. A 16-frame batch of mixed orientations won't be handled per-frame.
- Rounding to 8px means the result isn't exactly your target resolution, but "nearest multiple of 8 to the correct aspect ratio" is precisely what the latent wants.
Install is the pack-standard: ComfyUI Manager → search "Rikannodes", or git clone https://github.com/rikanrino/Rikannodes into ComfyUI/custom_nodes, install requirements.txt, restart. It appears under the Rikannodes category. The pack needs a reasonably recent ComfyUI (newer extension API) and its only declared dependency is word2number. A one-purpose node, but for aspect-ratio math it's the one you'll keep in the graph.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | IMAGE | — | |
| target_resolution | COMBO | 4K (UHD) | 4 options: 1080p (FHD), 2K (QHD), 4K (UHD), 8K (FUHD) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |