VNCCS Background Generator
One café, three times of day, same café
- pipe
- background
- backgrounds
- source_upscaled
- variations
What it's for
You have one good background image. A rainy street, a café, whatever the location is. Your visual novel needs that street at dawn, at noon, and at 2am with the shutters down - and it has to still read as the same street, or the reader's sense of place collapses.
VNCCS Background Generator is the batch half of the background pipeline. It takes the source image from VNCCS Background Creator, upscales it once, then runs every variant prompt through your chosen edit model, and optionally upscales each variant at the end. Three stages, in that fixed order, and it caches each one so a re-run only redoes the part that changed.
That caching is what makes it usable: generate six variants, decide number four is muddy, regenerate only number four. The 3.0 release's headline feature was per-sprite regeneration instead of re-running the batch, and this node carries the same idea into backgrounds.
How it works
Three stages, all visible in the node's progress output:
source_upscaler- the original background goes through SeedVR2 first, at your configured resolution cap. Front-loading the upscale is deliberate: variants generated from a clean, larger source keep more architecture detail than ones generated small and upscaled after. Set the upscaler tooffinwidget_dataand this stage is a pass-through.background_generation- for each variant prompt, the edit model renders a new image conditioned on the upscaled source plus the instruction ("Change time of the day to evening, weather to rain… Preserve the scene, viewpoint, framing, composition, architecture and objects."). The model comes from yourVNCCS_PIPE, and it must be one of the editing models: Qwen Image 2.1, Flux Klein9b, or MiniMax H3. MiniMax H3 takes a different path through the graph (reference-to-video with an audio VAE, then a frame decode), which is why it insists on the audio VAE being present.upscaler- optional final pass over each finished variant.
The stage order is enforced in code. If you ask it to regenerate from a stage other than the first, it checks the cached inputs still match - otherwise it fails with "Source cache is unavailable. Run Background Generator normally first" or "The background variants changed." Annoying when you hit it, correct when you think about it: you don't want a half-regenerated set where three variants came from the old source.
Inputs and outputs
It's a list-input node, which trips people up. Four required inputs:
pipe(VNCCS_PIPE) - the Control Center bundle with the editing model.background(IMAGE) - one source image, single. Not a batch; it rejects batches explicitly with "requires one source IMAGE, not an image batch". Come fromVNCCS Background Creator→image.prompt(STRING, forced input) - actually the list fromVNCCS Background Creator→Prompt. One JSON entry per variant, up to 64 of them. This is where the per-variant instructions live; you're not writing it by hand.widget_data- the settings blob: upscaler mode/model/resolution, sampler, target size, the background-removal block (unused here but shared with the character generator).
Outputs:
backgrounds(IMAGE, list) - the full set, source plus every variant, in order. This is what you browse.source_upscaled(IMAGE, single) - the SeedVR2-upscaled original, on its own, in case you want the clean plate without the variants.variations(IMAGE, list) - just the variants, no original. Use this if you're feeding a downstream consumer that expects only the derived images.
The node also writes the complete set beside the background's JSON in output/VNCCS/Backgrounds/, so your variants survive a ComfyUI restart even before you wire an output anywhere.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/AHEKOT/ComfyUI_VNCCS.git vnccs
cd vnccs
python -m pip install -r requirements.txt
Restart, then open VNCCS_3.4_Step4_BackgroundCreator.json - both background nodes are in that one workflow, already wired. Model files: Qwen Image 2.1 (and its text encoder) and the SeedVR2 upscaler weights via VNCCS Control Center; Moss, if you go that route, needs manual local files. SeedVR2 is worth having: it's been the detail-recovery incumbent since late 2025, Apache 2.0, and it runs on genuinely small cards - but it is a bigger model than people expect on first download.
Where people get burned
"Select a QI2, Klein9b or MiniMax H3 editing model in Control Center." Your pipe is holding a plain text-to-image model. This node edits an existing image; it needs the instruction-editing family. Go back to Control Center and check what you actually downloaded.
A batch where a single image was expected. If your background input has more than one image in it - usually because someone wired a list from another node - it fails fast. Insert an image-select node.
OOM during the source upscale, not the generation. SeedVR2 at the default 2048 target with a 3840 max on a 12GB card is where this dies. Drop the upscaler resolution, or set mode to off and accept variants generated from the raw source. The generation stage is comparatively cheap.
Regeneration refuses to start. Any of the "changed"/"cache is unavailable" errors means the cached inputs for an earlier stage don't match what's on disk now. Run the node normally once to rebuild the cache, then regenerate the single variant you wanted. It's a cache-coherence check doing its job.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | VNCCS_PIPE | — | |
| background | IMAGE | — | |
| prompt | STRING | — | |
| widget_data | STRING | {"common": {"target_size": 1024}, "upscaler": {"mode": "seedvr", "model": "seedvr2_3b_fp8_e4m3fn.safetensors", "vae": "ema_vae_fp16.safetensors", "device": "cuda:0", "offload_device": "cpu", "seed": 42, "inherit_pipe_seed": true, "resolution": 2048, "max_resolution": 3840, "batch_size": 1, "uniform_batch_size": false, "color_correction": "lab", "temporal_overlap": 0, "prepend_frames": 0, "input_noise_scale": 0, "latent_noise_scale": 0, "blocks_to_swap": 0, "swap_io_components": false, "cache_dit": true, "attention_mode": "sageattn_2", "attention_mode_manual": false, "encode_tiled": true, "encode_tile_size": 1024, "encode_tile_overlap": 128, "decode_tiled": true, "decode_tile_size": 1024, "decode_tile_overlap": 128, "tile_debug": "false", "cache_vae": false, "enable_debug": false}, "bg_remove": {"preset": "balanced", "use_sam3_details_recovery": false, "use_preset_values": true, "tolerance": 0.15, "softness": 0.12, "despill_strength": 0.65, "edge_width": 3, "matte_cleanup": 0.1, "foreground_recover": 0.35, "edge_decontaminate": 0.75, "edge_choke": 0.08, "matte_method": "screen_matte", "screen_mode": "from_background", "output_mode": "straight_rgba", "sam3_model": "", "sam3_segmentor": "image", "sam3_device": "auto", "sam3_precision": "bf16", "sam3_prompt": "face, clothes, accessories, hat, boots, eyes", "sam3_threshold": 0.4, "sam3_add_background": "none", "sam3_detection_limit": -1, "sam3_erode_radius": 4, "sam3_min_foreground_overlap": 0.55}, "pose_generation": {"target_size": 1024, "override_resolution": false, "resolution": 1024, "upscale_method": "lanczos", "crop_method": "disabled", "image1_name": "image 1", "image2_name": "image 2", "image3_name": "image 3", "weight1": 1.0, "weight2": 1.0, "weight3": 1.0, "vl_size": 384, "background_color": "from_generator", "latent_image_index": 1, "instruction": "Describe the character and their key features (body shape, physical characteristics, clothing, items, accessories). Then explain how the user's text instruction should alter or modify the character. Generate a new image that meets the user's requirements while maintaining consistency with the original character where appropriate."}, "pose_sampler": {"inherit_pipe": true, "seed": 0, "steps": 20, "cfg": 1.0, "sampler_name": "euler", "scheduler": "simple", "denoise": 1.0}, "vae_decode": {"tile_size": 512, "overlap": 64, "temporal_size": 64, "temporal_overlap": 8}, "emotion_generation": {"task_batch_size": 0, "target_size": 2048, "face_denoise": 0.55, "use_sam": false, "bbox_model": "bbox/face_yolov8m.pt", "segm_model": "bbox/face_yolov8m.pt", "sam_model": "sam_vit_b_01ec64.pth", "sam_device_mode": "AUTO", "guide_size": 1536, "guide_size_for": true, "max_size": 1536, "inherit_pipe_sampler": true, "sampler_name": "euler", "scheduler": "simple", "feather": 50, "noise_mask": true, "force_inpaint": true, "bbox_threshold": 0.5, "bbox_dilation": 50, "qi2_prompt_template": "Upscale face image.\nMake character's face emotion {emotion}\nChange only face. Keep original neck colour, clothes and hairs\nkeep character's clothes", "bbox_crop_factor": 3.0, "sam_detection_hint": "center-1", "sam_dilation": 0, "sam_threshold": 0.93, "sam_bbox_expansion": 0, "sam_mask_hint_threshold": 0.7, "sam_mask_hint_use_negative": "False", "drop_size": 10, "cycle": 1, "inpaint_model": false, "noise_mask_feather": 20, "tiled_encode": true, "tiled_decode": true, "matte_expand_radius": 8, "matte_feather_radius": 4, "chroma_context": 16}, "remove_clothes": {"prompt": "Dress character: White underwear", "target_size": 1024, "upscale_method": "lanczos", "crop_method": "disabled", "image1_name": "image 1", "image2_name": "image 2", "image3_name": "image 3", "weight1": 1.0, "weight2": 1.0, "weight3": 1.0, "vl_size": 384, "background_color": "White", "latent_image_index": 1, "instruction": "Describe the character and their key features (body shape, physical characteristics, clothing, items, accessories). Then explain how the user's text instruction should alter or modify the character. Generate a new image that meets the user's requirements while maintaining consistency with the original character where appropriate."}, "remove_clothes_sampler": {"inherit_pipe": true, "seed": 0, "steps": 20, "cfg": 1.0, "sampler_name": "euler", "scheduler": "simple", "denoise": 1.0}} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| backgrounds | IMAGE | — |
| source_upscaled | IMAGE | — |
| variations | IMAGE | — |