K2 Project Export
Turn your layout into a shareable K2Lab project file
- regions
- loras
- emphasis
- tuning
- projector
- plan
- project_json
K2 Project Export is the save button for the K2 Lab suite in comfyui-FVMtools. It serializes everything you've built - regions, LoRAs, emphases, tuning, projector, even the global prompts - into a single JSON string following the K2Lab project schema. From there you can paste it back into K2Lab / K2 Region Studio, store it next to your outputs, or feed it to K2 Project Import in another workflow to reproduce the layout exactly.
If you've built a two-character layout you like, this is how you keep it. The alternative - screenshotting your node graph and re-typing pixel coordinates from memory - is exactly the workflow this node exists to kill.
The inputs
width/height- canvas size, stored with the project so the boxes make sense when reopened.regions- the region chain to serialize.loras- the LoRA assignments.emphasis- phrase emphases.tuning- spatial tuning.projector- projector settings.plan- an alternative source for the regions when no region chain is connected (grab it from K2 Compose'splanoutput).global_prompt/negative_prompt- stored with the project, so a re-import restores the full text context too.
Output is a single project_json string. It's an output node - it runs and shows you the JSON, and you copy it out or save it to a file.
When you'll use it
Three cases. You're moving layouts between your own workflows and want them reproducible; you're collaborating and want to hand someone a layout without sending a .json workflow file and all its node positions; or you use K2Lab / K2 Region Studio as well as ComfyUI and want both tools to speak the same project format. The schema is the published K2Lab one, so a project exported here pastes into the standalone app - that's the round-trip the author built it for.
It pairs with K2 Project Import as the read side: export to a JSON string, keep it in a text file or a note, import it back whenever you need the layout again. Together they're the closest thing this suite has to named, saved scenes.
Install
Same as the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools
Restart ComfyUI, find it under FVM Tools/K2. No extra dependencies.
One habit worth forming: export at the point your layout is stable, and export again after you've tuned priority or role - those are exactly the fields that feel obvious at build time and impossible to remember a week later.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–16384 | Canvas width stored with the project. |
| height | INT | 102464–16384 | Canvas height stored with the project. |
| regionsopt | K2_REGION | Region chain to serialize. | |
| lorasopt | K2_LORA | LoRA assignments to serialize. | |
| emphasisopt | K2_EMPHASIS | Emphases to serialize. | |
| tuningopt | K2_TUNING | Spatial tuning to serialize. | |
| projectoropt | K2_PROJECTOR | Projector settings to serialize. | |
| planopt | K2_PLAN | Alternative source for the regions when no region chain is connected. | |
| global_promptopt | STRING | Global prompt stored with the project. | |
| negative_promptopt | STRING | Global negative stored with the project. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| project_json | STRING | — |