Nodes/ComfyUI_KubaNodes/kubakub canvas plan
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.

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
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)

NameTypeDefaultDescription
target_widthINT384016–32768Width of the final image in pixels (the matrix = the full projection image at delivery size).
target_heightINT216016–32768Height of the final image in pixels.
model_familyCOMBOflux2flux2: divisor 16, ~1 MP. ltxav: divisor 32, 8k+1 frames. minimax_h3: divisor 32, 17k+5 frames, 24 fps. sd_8: divisor 8.
kSTRING2Downscale 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_mpFLOAT0.000–16auto k: target megapixels on the model grid. 0 = the model's trained budget.
integer_kBOOLEANfalseauto k: only whole factors (needed for latent x2 paths).
target_framesINT00–10000Video models: frames wanted. Rounded up to the model's frame rule; Canvas Restore trims the extra frames. 0 = still.
pad_alignCOMBOcenterWhere the grid padding goes: split on both sides, or all at the end (right/bottom) or start (left/top).
max_pad_percentFLOAT2.00–50auto k: skip factors needing more padding (extra area in percent).
divisor_overrideINT00–256Force another size grid (e.g. 64). 0 = the model's own.
size_fromoptIMAGETake the target size from this image instead of the widgets.

Outputs (10)

NameTypeDescription
canvas_planKUBA_CANVAS_PLANThe plan; connect to canvas to work and canvas restore.
widthINTModel grid width (padded). Use for the empty latent.
heightINTModel grid height (padded).
framesINTFrames to generate (1 for stills).
fpsFLOATFrame rate the model generates at.
plan_jsonSTRINGThe plan as text, for saving or checking.
reportSTRINGReadable summary: work size, padding, k, frames.
kFLOATThe downscale factor that was used (target = work x k), e.g. 2.0 or 3.75. Useful after 'auto'.
target_widthINTWidth of the final image in pixels (from the widget or size_from).
target_heightINTHeight of the final image in pixels.