Comflowy Omost Load Canvas Python Code
Drop in the official demo's code, keep the pack's pipeline
- OMOST_CANVAS_CONDITIONING
Omost's official demo app lets you describe a scene and watch it get turned into code - literal Python that constructs a canvas, complete with set_global_description and add_local_description calls for every region. The Comflowy Omost Load Canvas Python Code node exists for exactly that output: you paste the generated Python into this node, and it becomes an OMOST_CANVAS_CONDITIONING object that feeds the rest of the pack's Omost pipeline. It's the sibling of Comflowy Omost Load Canvas Conditioning - that one takes JSON, this one takes code.
Who is this for? Anyone who wants Omost's editor experience without Omost's local model. The official Omost demo's canvas builder produces Python code, and if you've been fiddling with it to get a layout just right, the natural move is to bring that hard-won layout into ComfyUI. This node is the import path. It's also genuinely handy for sharing: Omost demo code is compact and human-readable, so a "canvas in a code block" travels better than a wall of JSON.
How it works and the input
The node parses the Python string with Omost's Canvas.from_python_code - the same code Omost itself uses to read its demo output - then runs canvas.process() to produce the region conditions. The parsing is real: it walks the set_global_description and add_local_description calls and builds the canvas structure from them. If the code doesn't match Omost's expected call shapes, you'll get a parse error, not a silent misrender.
- python_str (required, multiline) - the Omost demo code.
Output: OMOST_CANVAS_CONDITIONING, flowing into Comflowy Omost To Conditioning or Comflowy Omost Preview like any other canvas source.
Installing and the gotchas
Install Comflowy's Custom Nodes via ComfyUI Manager (search "Comflowy") or git clone https://github.com/6174/comflowy-nodes into custom_nodes, restart. No API key, no model downloads - the Omost canvas machinery ships inside the pack.
The gotchas:
- It expects Omost's exact code format. The Omost demo app emits a specific style of canvas-building calls. If you hand-write Python that uses different variable names or a different structure,
from_python_codemay not recognize it. When in doubt, generate from the official demo and edit that. - The JSON sibling is more forgiving for hand-editing. If you're going to tweak a layout repeatedly, Comflowy Omost Load Canvas Conditioning (JSON) is often easier to edit than code. Use the Python node when you have demo output to import; use JSON when you're doing surgical edits.
- Downstream validation still applies. A canvas that parses but has, say, an empty
detailed_descriptionswill behave oddly when encoded into conditioning - the greedy encoding step is picky. Preview with Comflowy Omost Preview before committing a full sampler run.
If you've ever gotten a layout right in the Omost demo and wished you could just use it in ComfyUI, this is the direct bridge. Copy, paste, wire up, render.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| python_str | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| OMOST_CANVAS_CONDITIONING | OMOST_CANVAS_CONDITIONING | — |