Nodes/comfyui-fvmtools/K2 Project Export
ComfyUI Node

K2 Project Export

Turn your layout into a shareable K2Lab project file

By ping1979ping·Created 6 months ago·Updated about a month ago· 0
K2 Project Export
  • regions
  • loras
  • emphasis
  • tuning
  • projector
  • plan
  • project_json
width1024
height1024
global_prompt
negative_prompt

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's plan output).
  • 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.

CategoryFVM Tools/K2

Inputs (10)

NameTypeDefaultDescription
widthINT102464–16384Canvas width stored with the project.
heightINT102464–16384Canvas height stored with the project.
regionsoptK2_REGIONRegion chain to serialize.
lorasoptK2_LORALoRA assignments to serialize.
emphasisoptK2_EMPHASISEmphases to serialize.
tuningoptK2_TUNINGSpatial tuning to serialize.
projectoroptK2_PROJECTORProjector settings to serialize.
planoptK2_PLANAlternative source for the regions when no region chain is connected.
global_promptoptSTRINGGlobal prompt stored with the project.
negative_promptoptSTRINGGlobal negative stored with the project.

Outputs (1)

NameTypeDescription
project_jsonSTRING