PettyPaintProcessor
The orchestrator that reads the project JSON and tells the graph what to generate next
- value
- any
- output
- model
- vae
- steps
- samplers
- cfg
- scheduler
- prompt
- negative_prompt
- page_cell_path
- positivePrompts
- negativePrompts
- composition
Most nodes do one small thing. PettyPaintProcessor is the opposite: it's the brain of the whole petty-paint pipeline, the node that reads the app's project JSON, figures out what still needs to be generated, and hands the rest of the graph everything it needs to generate it - model, prompts, sampler settings, even a composition plan. If the pack is the ComfyUI-side integration for Petty Paint (Andrew Porter's web canvas that reimagines doodles via Stable Diffusion), this is where the "decide what's missing" logic actually lives.
Honest framing: this is deep plumbing for a specific workflow. If you're not running the full Petty Paint comic/character pipeline, this node is mostly interesting as a case study in state-driven generation. If you are, it's the heartbeat.
How it works
file_path points at the project's JSON state file (the pack's model_dict.json style). The node walks through the state: which checkpoints to use (and which to skip), which characters exist, which poses each character needs, which pages and cells are expected. For each, it checks the storage folder - counting files against expected_files (the threshold for "this character is done," default 4) - and the first thing that's missing or incomplete becomes the "generate this next" target.
When it finds work, it writes the updated state back to file_path (so the app and the graph stay in sync) and emits a bundle of outputs: the full JSON, a diagnostic text log, the chosen checkpoint model, the vae, steps, samplers list, cfg, scheduler, and the assembled positive/negative prompts for this job. The composition output is the interesting one - a JSON blob describing which character renders and masks to composite for the target scene cell, which is exactly what PettyPaintImageCompositeMasked and the save/load nodes consume downstream.
The inputs and outputs
value-any; a pass-through trigger (the node mostly cares about the file).file_path- STRING; the JSON project file to read and update.expected_files- INT (0–120); file-count threshold for "done."- Outputs:
any(the JSON),output(diagnostic text),model,vae,steps,samplers,cfg,scheduler,prompt,negative_prompt,page_cell_path,positivePrompts,negativePrompts, andcomposition.
That's 14 outputs. A typical chain: model and vae into loaders, prompt/negative_prompt into a CLIP encode, steps/cfg/sampler/scheduler into a PettyPaintKSampler, and composition into the composite stage.
Installing it
Same pack, same install - ComfyUI Manager, search "petty-paint-comfyui-node":
cd ComfyUI/custom_nodes
git clone https://github.com/mephisto83/petty-paint-comfyui-node
Restart ComfyUI. Declared dependency is Flask==2.1.2; the models are your normal checkpoints, and the JSON comes from the app.
Common issues
The failure mode to expect is "no scene found" - if the state JSON references a scene that doesn't exist, the node raises and sets an errored flag in the context rather than failing loudly in the UI, so check the output text log for diagnostics. expected_files is easy to misjudge: too low and characters get marked "done" with partial renders; too high and it never moves on. And since the node writes to file_path, make sure that path is writable - a read-only file silently means the state never advances, which looks like "nothing happens."
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value | * | — | |
| file_path | STRING | — | |
| expected_files | INT | 40–120 | — |
Outputs (14)
| Name | Type | Description |
|---|---|---|
| any | * | — |
| output | STRING | — |
| model | STRING | — |
| vae | * | — |
| steps | INT | — |
| samplers | euler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,ddim,uni_pc,uni_pc_bh2 | — |
| cfg | FLOAT | — |
| scheduler | * | — |
| prompt | STRING | — |
| negative_prompt | STRING | — |
| page_cell_path | STRING | — |
| positivePrompts | STRING | — |
| negativePrompts | STRING | — |
| composition | * | — |