Nodes/comfyui-moonpack/MOSS Regional Layout
ComfyUI Node

MOSS Regional Layout

Draw MOSS-Image layout boxes, caption them and give each box its own LoRAs. Outputs the MOSS layout prompt and a MODEL whose LoRAs only act inside their box (token-masked bypass). Scene LoRAs act on the whole image or only outside the LoRA boxes. Editor based on kijai's MOSS-Image Prompt Builder (KJNodes).

By moonwhaler·Created about a year ago·Updated about 16 hours ago· 19
MOSS Regional Layout
  • model
  • image
  • bboxes
  • clip
  • MODEL
  • prompt
  • preview
  • mask_preview
  • bboxes
  • width
  • height
◄width1024►
◄height1024►
◄prompt►
◄meta►
◄canvasnone►
◄feather0.10►
◄skirt0.00►
◄text_tokens▾►
◄ownership▾►
◄measure_until0.30►
◄spill0.10►
◄elements_data►
◄scene_loras_data►
◄style_palette_data►
◄bg_brightness25►
◄import_modewhen empty►
◄output_formatcompact►
◄import_json—►
CategoryMoonPack/lora

Inputs (22)

NameTypeDefaultDescription
modelMODEL—
widthINT102464–16384Generation width: the boxes are placed in its pixels.
heightINT102464–16384Generation height: the boxes are placed in its pixels.
promptSTRINGDescription of the whole scene and its style (summary.caption).
metaSTRINGOptional comma-separated summary.meta tags.
canvasCOMBOnoneOptional summary.canvas.
featherFLOAT0.100–0.3Soft LoRA mask edge, as a fraction of the box's shorter side.
skirtFLOAT0.000–0.25Grows every LoRA mask by this fraction of the image's shorter side.
text_tokensCOMBOmasked: box LoRAs skip the text tokens (least bleed). global: box LoRAs also act on all text tokens (more bleed). own caption: each box LoRA also acts on its own caption's tokens, e.g. its trigger words (needs the clip input).
ownershipCOMBObox: the drawn boxes decide where each LoRA acts (box 1 is in front). attention: during the first steps the node measures which caption each image area belongs to, then overlaps and the area around a box go to the character that is actually there (needs the clip input).
measure_untilFLOAT0.300.05–0.9attention ownership: fraction of sampling used to measure; the box masks apply meanwhile.
spillFLOAT0.100–0.3attention ownership: how far beyond its box a LoRA may follow its subject, as a fraction of the image's shorter side.
elements_dataSTRING—
scene_loras_dataSTRING—
style_palette_dataSTRING—
bg_brightnessINT250–100—
import_modeCOMBOwhen empty2 options: when empty, always
output_formatSTRINGcompact—
imageoptIMAGEOptional background for the editor and the preview.
import_jsonoptSTRINGOptional MOSS-Image layout JSON to load into the editor.
bboxesoptBOUNDING_BOXOptional pixel boxes to seed an empty editor.
clipoptCLIPThe MOSS text encoder used for this prompt. Only needed for ownership = attention and text_tokens = own caption; it is used to find each box caption's tokens, the prompt is not changed.

Outputs (7)

NameTypeDescription
MODELMODEL—
promptSTRING—
previewIMAGE—
mask_previewMASK—
bboxesBOUNDING_BOX—
widthINT—
heightINT—