ComfyUI Node
kubakub canvas plan
Work out the size a model should generate at, so the result scales back to your target without stretching. The work canvas is target / k for one uniform factor k, padded to the model's size grid, never stretched. Feed width/height to the empty latent and the plan to Canvas To Work / Canvas Restore.
kubakub canvas plan
- size_from
- canvas_plan
- width
- height
- frames
- fps
- plan_json
- report
- k
- target_width
- target_height
◄target_width3840►
◄target_height2160►
◄model_familyflux2►
◄k2►
◄budget_mp0.00►
◄integer_kfalse►
◄target_frames0►
◄pad_aligncenter►
◄max_pad_percent2.0►
◄divisor_override0►
Categorykubakub/2d/regions/canvas
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| target_width | INT | 384016–32768 | Width of the final image in pixels (the matrix = the full projection image at delivery size). |
| target_height | INT | 216016–32768 | Height of the final image in pixels. |
| model_family | COMBO | flux2 | flux2: divisor 16, ~1 MP. ltxav: divisor 32, 8k+1 frames. minimax_h3: divisor 32, 17k+5 frames, 24 fps. sd_8: divisor 8. |
| k | STRING | 2 | Downscale factor target -> work. A number (2, 2.5), a fraction (15/4) or 'auto' to pick from the MP budget. It must divide the target into whole pixels. |
| budget_mp | FLOAT | 0.000–16 | auto k: target megapixels on the model grid. 0 = the model's trained budget. |
| integer_k | BOOLEAN | false | auto k: only whole factors (needed for latent x2 paths). |
| target_frames | INT | 00–10000 | Video models: frames wanted. Rounded up to the model's frame rule; Canvas Restore trims the extra frames. 0 = still. |
| pad_align | COMBO | center | Where the grid padding goes: split on both sides, or all at the end (right/bottom) or start (left/top). |
| max_pad_percent | FLOAT | 2.00–50 | auto k: skip factors needing more padding (extra area in percent). |
| divisor_override | INT | 00–256 | Force another size grid (e.g. 64). 0 = the model's own. |
| size_fromopt | IMAGE | Take the target size from this image instead of the widgets. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| canvas_plan | KUBA_CANVAS_PLAN | The plan; connect to canvas to work and canvas restore. |
| width | INT | Model grid width (padded). Use for the empty latent. |
| height | INT | Model grid height (padded). |
| frames | INT | Frames to generate (1 for stills). |
| fps | FLOAT | Frame rate the model generates at. |
| plan_json | STRING | The plan as text, for saving or checking. |
| report | STRING | Readable summary: work size, padding, k, frames. |
| k | FLOAT | The downscale factor that was used (target = work x k), e.g. 2.0 or 3.75. Useful after 'auto'. |
| target_width | INT | Width of the final image in pixels (from the widget or size_from). |
| target_height | INT | Height of the final image in pixels. |