K2 Project Import
Bring a K2Lab project into your ComfyUI graph, boxes and all
- regions
- loras
- emphasis
- tuning
- projector
- global_prompt
- negative_prompt
- width
- height
- info
K2 Project Import is the bridge between the standalone K2Lab desktop app (the Krea 2 bbox-prompting tool that kicked off this whole regional-control movement) and your ComfyUI graph. It takes a K2Lab / K2 Region Studio project JSON and turns it into normal K2 graph objects: regions, regional LoRAs, emphases, tuning, and projector. Paste a project you made in the standalone tool - or one a collaborator shared - and the whole layout arrives in ComfyUI ready to wire into K2 Compose.
The inputs
project_json- the project JSON (multiline, default{}). It accepts the published schema (version 1) withregions,loras,emphases,spatial, andprojectorkeys. Region boxes may be given as{x0,y0,x1,y1}or{x,y,width,height}- both handled.width/height- the canvas the stored pixel boxes refer to. Set these to the canvas the project was designed on; the boxes are interpreted against it.strict_lora_names- on (default): a LoRA file in the project that isn't installed raises an error. Off: it's skipped and listed in theinfooutput. The default is the right default - a missing LoRA should be loud, not silent.
The outputs
regions, loras, emphasis, tuning, projector - the full K2 object set, which is exactly the set of optional inputs K2 Compose accepts. Plus global_prompt, negative_prompt, width, height, and an info string (which is where skipped LoRAs get listed when strict mode is off).
What "project" means here
Two uses worth knowing. First, round-tripping with the standalone app: you build a layout in K2Lab, export it, paste it here. Second, workflow portability inside ComfyUI: pair it with K2 Project Export, and you can save a layout to JSON, store it next to your outputs, and reproduce the exact layout in another workflow later. The import/export pair is the save-file system this suite doesn't otherwise have.
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.
The one gotcha is model inventory: the project references LoRAs by file name, and import matches them against your local models/loras by name. If a file is missing, strict mode tells you immediately - that's the feature working, not a bug. Get the file, re-run, and the layout lands complete.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| project_json | STRING | {} | K2Lab / K2 Region Studio project JSON. |
| width | INT | 102464–16384 | Canvas the stored pixel boxes refer to. |
| height | INT | 102464–16384 | Canvas height the stored boxes refer to. |
| strict_lora_namesopt | BOOLEAN | true | On: a LoRA file that is not installed raises an error. Off: it is skipped and listed in the info output. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| regions | K2_REGION | — |
| loras | K2_LORA | — |
| emphasis | K2_EMPHASIS | — |
| tuning | K2_TUNING | — |
| projector | K2_PROJECTOR | — |
| global_prompt | STRING | — |
| negative_prompt | STRING | — |
| width | INT | — |
| height | INT | — |
| info | STRING | — |