This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

ComfyUI tools

Reusable ComfyUI custom nodes and image-generation workflows

This project owns reusable ComfyUI nodes, workflows and evaluation tooling. Each node has its own directory under nodes/, with its implementation, test and README. Workflow definitions are grouped by model under workflows/. Evaluation code and reusable cases live here; run configuration and deployment, model downloads, credentials and rental state belong to image-generation infrastructure. The repository CLI and local launchers remain in tools/comfyui.

The workflow files, including the Flux panel sequence, contain single-reference, character/style and prompt-sequence graphs for FLUX.2 klein Base and Qwen-Image-Edit, plus Juggernaut XL v9, NoobAI XL 1.1, Illustrious XL v2.0-STABLE, HiDream-I1 Full, full Chroma, MOSS-Image and archived Chroma Flash examples. All files use <profile>-<purpose>.json; the saved workflow name uses that same basename. Load a matching JSON in ComfyUI or pass it to the authenticated infrastructure CLI. Each graph requires its matching models and nodes; the rental’s model profile selects which files to install. Keeping a workflow here does not install its dependencies or establish runtime acceptance.

The Juggernaut txt2img, img2img and prompt sequence use the native SDXL checkpoint loader with the encoder and VAE bundled in the checkpoint. Start with 1024-square output, 30 DPM++ 2M SDE/Karras steps and CFG 6.5. Img2img starts at denoise 0.65 and preserves some reference composition; it does not extract only its style. Use style reference for a new scene guided by a reference image, or style prompt sequence for several panels sharing that style. Both use the previously approved RES4LYF pack, its SDXL patcher and a VAE-encoded style guide while sampling from fresh noise. The guide’s weight starts at 1; zero disables it for a fixed-seed comparison. Describe the broad medium and new scene in the prompt. These graphs start at 30 RES 2M/beta57 steps and CFG 6.5. They guide style; they do not guarantee exact style isolation or character preservation. Offline graph checks do not establish GPU execution or style quality.

For several references that contain both characters and style, use juggernaut-multi-reference, or juggernaut-multi-reference-prompt-sequence for a sequence. Select three reference files; reuse a file if you have fewer. Each reference is resized and center-cropped to 512 square, then all three feed the approved SDXL Plus IP-Adapter with concatenated reference embeddings. The standard SDXL sampler starts from fresh noise. The adapter’s weight starts at 0.8; raise it for more reference influence or lower it for more prompt freedom. For more scene adherence, try weight 0.5 and end_at 0.8; this retained the neutral references’ geometric style while adding the requested reading scene in the live comparison. Keep linear for general subject/style conditioning. Describe the wanted scene, characters and medium in text as well. These workflows guide appearance and style; they do not guarantee exact identities or isolate every character in a crowded reference. The sequence uses the same references for each panel.

The adapter uses the approved ComfyUI_IPAdapter_plus revision and publisher-pinned SDXL Plus and CLIP-ViT-H weights. Upstream is in maintenance-only mode; future runtime upgrades need compatibility validation. The older RES4LYF style graphs retain the upstream float64 style-patcher default to avoid mixing float32 reference features with its float64 SDXL branch.

noobai and illustrious provide the same seven SDXL workflow purposes as Juggernaut. NoobAI also provides noobai-image-to-image-prompt-sequence: enter one prompt per nonempty line in Prompt Sequence; every image starts from the same original reference. It saves separate PNGs with shared negative text, a panel counter and unique grouped filenames. Adjust output dimensions in ImageScale and denoise in KSampler (default 0.65). They reuse the shared SDXL builder, style patcher and approved IP-Adapter/CLIP vision weights. Native graphs start at 30 Euler ancestral/normal steps and CFG 5.5; NoobAI uses neutral tag-style starting prompts. These are starting presets, with no new GPU acceptance or reference-quality claim. NoobAI’s publisher restricts commercial use, including generated products; the model configuration records the licenses and component choices.

hidream-i1-full provides text-to-image, img2img, style-reference, all three panel sequences and ordinary/masked chained img2img GIFs. The img2img sequence reuses the same original reference for each prompt, with editable output dimensions and denoise. Native graphs use 50 UniPC/simple steps, CFG 5 and shift 3, following the official full-model example. They load four local text encoders: CLIP-L, CLIP-G, T5 and Llama 3.1 8B. Style graphs reuse RES4LYF with its dedicated HiDream patcher and style sampler. This is style guidance; it is not a trained character-reference adapter. Its GIF workflow completed the approved plush case on a verified datacenter CMP 170HX 40 GiB on 2026-11-11. The output drifts in appearance and does not establish convincing petting motion. Other HiDream workflows still have offline packaging checks only; their GPU execution and output quality remain unverified.

uso provides native subject-only, style-only and combined subject/two-style reference workflows, each with a prompt-sequence variant. umo-uno provides single and three-identity reference workflows and their sequences, without USO’s style-projector branch. They share the native FLUX.1 graph builder, load matching model adapters and preserve the publisher’s reference positioning. All sequences reuse the same original reference inputs per prompt and keep progress plus uniquely grouped filenames. Both families expose output size and native sampling controls. At CFG 1 their sequence negative output is unused. See the model options for workflow names, reference roles and starting settings. Source and offline packaging are available; GPU compatibility and reference quality are untested.

All seven Juggernaut workflows completed on the replacement rental on 2026-11-10, producing 13 neutral 1024-square images at 30 steps. Both style paths completed without the reported dtype error. This establishes execution for the selected runtime; reference fidelity and scene adherence still depend on inputs and guidance settings. The original WCT paths produced softer images in this check than the adapter path. Deployment evidence belongs to the owning infrastructure record.

For FLUX.2 dev 32B, use flux2-dev-text-to-image without a reference, flux2-dev-single-reference with one image, or flux2-dev-multi-reference with three images. Both reference paths have a matching -prompt-sequence variant. Reference images supply character and style through native VAE latents. Start at 1024 square, 28 Euler steps and FluxGuidance 4. This model uses distilled positive guidance and has no negative branch; the sequence node’s negative output is unconnected in this family. Its Mistral text encoder runs locally.

The chroma-hd profile provides text-to-image, image-to-image, style-reference, prompt-sequence and style-prompt-sequence workflows with the full Chroma1-HD checkpoint, FP16 T5 and original VAE, plus a chained img2img GIF workflow with one prompt per frame. Native sampling starts at 40 Euler/beta steps and CFG 3; style sampling uses the already approved RES4LYF Chroma patcher and 40 RES 2M/beta57 steps with CFG 3. Its style guide starts at weight 0.5 and ends at step 15, which preserved more detail than weight 1 through all steps in the controlled neutral comparison. The two sequences use the existing multiline node and shared negative prompt. Img2img preserves composition; the style path guides style from fresh noise and does not promise character identity. The original three chroma-* workflows retain their Flash defaults as archived examples.

The full Chroma GPU acceptance verifies execution and ordered outputs, with significant visual limits: img2img can preserve the source too strongly, the style guide can blur detail, and comic wording can elicit extra panels and lettering. Start with native text-to-image; reference and sequence paths require prompt/strength tuning for useful results.

The moss-image family supplies six examples and six prompt-sequence variants, adapted from the official templates as compact native graphs without the optional LLM prompt enhancer. Their model files come from the infrastructure profile; generation uses local Qwen3.5 text encoding and the small FLUX.2 VAE.

  • moss-image-text-to-image and moss-image-base-text-to-image use SFT and Base, respectively, with 1024-square output, 25 ER-SDE/simple steps, CFG 2.5 and layer-22 skip guidance through the first half of sampling.
  • moss-image-layout-guided and moss-image-base-layout-guided add an editable native bounding-box canvas. Edit the box description and overall caption; canvas size drives the prompt coordinates and output latent dimensions.
  • moss-image-image-edit requires reference.png selected in Load Image. Edit its instruction; the example uses the SFT edit LoRA, Moss-Image-Edit reference conditioning on both branches, 30 Euler/normal steps and CFG 4. The reference is scaled to about one megapixel and determines the output dimensions.
  • moss-image-color-depth-control requires prepared color-map.png and depth-map.png selected in their Load Image nodes. Start with both maps at 1024 square. Region colors are identifiers; depth is white near the viewer. Disconnect an optional map input to use only the other map. Change the latent dimensions when using another size. The example uses the control LoRA, layer-24 skip guidance, shift 5, temporal score rescaling, 25 ER-SDE/simple steps, CFG 3 and control ending at 60% of sampling. It does not estimate depth.

The sequence variants use the existing multiline Prompt Sequence node:

  • moss-image-prompt-sequence and moss-image-base-prompt-sequence
  • moss-image-layout-prompt-sequence and moss-image-base-layout-prompt-sequence
  • moss-image-image-edit-prompt-sequence
  • moss-image-color-depth-prompt-sequence

Enter one panel prompt per nonempty line, shared context and shared negative text in Prompt Sequence. One Run saves ordered PNGs with a fresh grouped filename prefix and displays panel progress. Layout variants reuse the same box captions and positions; edit variants reuse the original reference for every instruction; control variants reuse the selected maps. Panels are independent generations, with no joint attention or guaranteed character continuity. Sampling defaults and reference requirements match the corresponding single-image examples.

The image-generation Ansible stage installs all twelve selected examples. You can also save a generated workflow through the authenticated API, for example:

bazel build //projects/comfyui_tools/workflows:workflows
bazel run //infra/image_gen:comfy -- workflow save \
  "$PWD/bazel-bin/projects/comfyui_tools/workflows/moss-image/moss-image-prompt-sequence.json" \
  --name moss-image-prompt-sequence --where local

Repeat the save command for the other five sequence variants. This stages user workflows without replacing the running rental or changing its startup command.

These are editable examples, not guarantees of exact edits, layout or reference fidelity. Actual GPU execution and its limitations belong to the deployment record.

The maintained sources are workflows.jsonnet, model-specific workflows.libsonnet files and shared graph/node libraries in workflows/internal/. The sequence transformation is shared across model families. Connections are declared once; generation derives port metadata and reciprocal link lists. SDXL model families share one graph builder. The public rental configuration owns an asset registry keyed by filename; profiles reference those assets and approved node packs by name. Workflows select the first download of each required kind, with explicit component roles for HiDream’s four text encoders. Additional downloads remain available without changing those selections. Recorded workflow defaults remain available when downloads are disabled.

bazel build //projects/comfyui_tools/workflows:workflows
bazel test //projects/comfyui_tools/workflows:format_test

Native JSON is generated beneath bazel-bin/projects/comfyui_tools/workflows/<profile>/ at the documented names. Edit Libsonnet source rather than generated JSON. Terraform and documentation consume those declared outputs directly. The pinned Jsonnet compiler and formatter are build tools and are never installed on the rental. To format an edited source, pass its absolute path to bazel run //tools/jsonnet:format -- --in-place /absolute/path/to/source.libsonnet.

Import noobai/noobai-sketch-edit.app.json for a whole-image edit, or noobai/noobai-sketch-edit-masked.app.json to restrict the edit with a painted mask. Matching .json files open in Graph Mode. Both reuse NoobAI XL 1.1 and the profile’s existing Canny ControlNet; no additional weights or node pack is needed. These are still-image editors, separate from the sequence Apps.

Choose the original picture in Source image and an aligned outline drawing in Separate sketch. The source supplies starting pixels; only the sketch supplies structural edges. Draw the desired final outline, removing obsolete lines. Arrows, crossed-out parts and written annotations are not edit commands. Keep both inputs on the same framing and aspect ratio. The output canvas starts at 1024 square; change its width and height to multiples of eight matching the source aspect ratio. Source and sketch are resized to that canvas without cropping.

Describe the complete finished image in NoobAI tags, including appearance, setting and the desired pose. Denoise starts at 0.65: raise it for larger changes or lower it to retain more source composition. Strength starts at 0.7 and controls sketch influence; end_percent starts at 0.8. Set strength to zero with the same seed for an unguided comparison. The two Canny thresholds start at 0.1/0.3; lower them if faint sketch lines are missing. Clear outlines are the intended input; rough scribbles are not a dedicated scribble-control path.

For the masked variant, open the source loader in Graph Mode, use its native Mask Editor, paint the allowed edit area and save the edited input before running. White permits edits; black preserves the source. Cover both the old shape and the space the new shape will occupy. An empty mask returns the resized source unchanged. The same resized mask controls sampling and final compositing, preserving source pixels wherever it is zero. The unmasked App edits the whole canvas. Each run saves one PNG with native generation metadata.

Offline graph and deployment checks do not establish sketch fidelity, anatomical correctness or precise pose edits. GPU inference for these new graphs has not been performed. Profile selection stages the files through the normal Ansible deployment; importing an App does not install its model weights.

Import the generated noobai/noobai-image-sequence.app.json from the workflow build into ComfyUI. It opens in native App mode with a reference uploader, shared appearance/style text, an action editor and a results gallery. Use Graph Mode to inspect its editable graph. The App targets frontend 1.57.6, bundled with the configured ComfyUI v0.44.0. Its .app.json filename also identifies it in ComfyUI’s Apps list. NoobAI workflows are saved through the authenticated workflow API after boot, keeping its startup within the provider limit. The complete catalog remains generated and importable; model and node installation still uses normal provisioning. The matching noobai-image-sequence.json opens the same graph in Graph Mode. It requires the NoobAI checkpoint, approved SDXL Plus adapter/CLIP vision weights and the first-party image_sequence module; an imported JSON alone does not install those dependencies. Build with:

bazel build //projects/comfyui_tools/workflows:workflows

Select the main appearance reference and optionally two additional views; keep unused inputs at (none). These references remain active for the whole sequence. Use the shared prompt for stable appearance and style. Enter complete desired-image tags, one image per nonempty line:

standing, snowy park, beside a bench
sitting, snowy park, on a bench
---
standing, library, beside a bookshelf
reading, library, holding an open book

The first image in each scene starts from fresh noise. The following images edit the preceding decoded result at change strength, initially 0.6. Raise it for larger changes, lower it to retain more composition, and insert --- for a new location or camera setup. No page layout, speech bubbles or comic style is added automatically. Describe the wanted medium in the shared prompt.

Reference weight starts at 0.05; stronger generic SDXL conditioning can distort NoobAI instead of preserving identity. Choose dimensions once for the whole sequence. Keep the seed fixed while tuning. Set image count to 1 for a single preview, or 0 for all remaining actions. For continuation, keep the complete action list, select the accepted preceding image in continuation, and set start image to the next action number. Starting inside a scene requires that image. Starting at a scene boundary creates a fresh composition. Completed PNGs are saved immediately with grouped ordered filenames and effective prompt/seed metadata; the App gallery populates on completion.

The default action list demonstrates two scenes with three images each: a robot raises its hand in a snowy park, then opens a book in a library. Camera, location and lighting tags repeat within each scene; --- changes the scene. Keep shared appearance tags in the shared prompt and describe the complete desired image on each action line.

The selected run produces one combined GIF and no per-scene GIF files. GIF frame duration defaults to 500 milliseconds per keyframe. Interpolation multiplier defaults to 4x using the repository-pinned RIFE engine; 1 disables interpolation. Each scene is smoothed separately and the combined GIF retains hard scene cuts. Original PNGs remain available after interruption; no partial GIF is published. Partial runs include only new images.

Control strength defaults to 0.2 in the App and guides same-scene edits from the preceding image’s Canny edges. Zero disables it. Control end defaults to 0.75. Lower the strength for larger pose changes; edges can resist those changes. New scenes start without the old scene’s guide.

The App starts IP-Adapter reference influence at 0.05 for NoobAI. The generic SDXL adapter can overwhelm this checkpoint at stronger weights. Shared appearance tags and previous-image continuation provide additional continuity; exact identity across fresh scenes and precise pose edits are not guaranteed.

After an authorized NoobAI deployment, use the infrastructure owner’s in-place update to install the node, approved Canny checkpoint, App and RIFE engine. NoobAI defers this node’s source and workflow documents to that stage to keep startup below its payload limit. The App can also be refreshed through the authenticated workflow API:

bazel run //infra/image_gen:comfy -- workflow save \
  "$PWD/bazel-bin/projects/comfyui_tools/workflows/noobai/noobai-image-sequence.app.json" \
  --name noobai-image-sequence.app --where local

The node contract describes partial runs, interruption and drift limits. Offline checks verify transitions and saved media. The live acceptance records the completed two-scene GPU run and its remaining pose/identity limits.

Two separate native Apps make the different generation strategies explicit:

AppReused informationGeneration
noobai-reference-sequence.app.jsonUploaded references, shared appearance text and preceding pixels within a sceneFresh scene starts, then previous-image edits; incrementing action seeds
noobai-scene-composer.app.jsonFixed character/clothing/style text, per-scene setting and optional installed LoRAIndependent images with a fixed seed and a second latent refinement pass

Both have matching editable .json graphs and six-image, two-scene examples. Both save PNGs and one combined GIF. Their new presets start with interpolation disabled; the reference preset also starts Canny at zero to avoid locking the previous pose. Existing noobai-image-sequence files remain import-compatible.

The composer adapts the shared-prompt organization and two-pass sampler in the operator-supplied Tache Scenes Composer, without its external prompt/utility node packs or preset library. Enter a fixed character description, clothing and render style. Enter one setting per scene on separate lines, or one setting for all scenes. Enter one desired-image action per line, using --- between scenes. Settings are expanded into the effective prompts before sampling. The default uses an adult woman in a red coat in a snowy park, then a library.

The optional LoRA selector lists only locally installed weights and defaults to (none). It installs nothing. The second pass uses the same model, prompt and seed to resample each first-pass latent at lower denoise; it does not transfer information between images. Set refinement steps to zero to disable it. Shared tags and a fixed seed are not an identity lock, and refinement can worsen an image. This version does not use uploaded reference images. Inspect individual PNGs before enabling interpolation; smoothing cannot correct missing actions.

The Prompt Sequence node uses ComfyUI’s native multiline text box. Select line and enter one prompt per line; blank and whitespace-only lines are ignored, so they can separate prompts visually. Select blank line only when each panel description spans several lines. The sequence node also contains a shared negative_prompt text box. In the Juggernaut, Flux Base and Qwen sequence workflows, its value applies to every panel and is not split into lines or combined with positive context. The generated sequence graphs connect it to the model’s native negative encoder, replacing the separate editable negative-prompt box. Juggernaut retains its existing negative default; Flux and Qwen start empty. The encoder remains in the graph to provide conditioning to the sampler.

Earlier saved nodes retain their first four input positions and their prompt/filename output slots; an omitted negative prompt defaults to empty. For Flux/Qwen, shared context describes image 1 as the character and image 2 as style. Juggernaut’s native sequence uses shared textual character and style descriptions; its style-sequence variant also reuses one reference image for style. Run a prompt-sequence workflow once for sequential panels named comic_<run UUID>_001, comic_<run UUID>_002, and so on. Each run has a unique prefix, including repeated runs with identical text. The sequence remains one native job so its media outputs remain grouped. The native sampler displays Panel 2 of 3 alongside its step progress; current workflows connect the sequence node’s optional MODEL path to enable that counter. Sampling batch size remains one; native list mapping reuses the shared conditioning. Panels do not inherit previous-panel composition or story state. The node requires no external package. The JSON separator remains available for lists saved by the former custom editor.

Use chroma-hd-image-to-image-gif to animate from an initial image, with one prompt per generated frame in the same multiline box. Each decoded image is VAE-encoded for the next img2img step. The result is one looping GIF and a native frame batch; start at denoise 0.45 and 6 fps. This makes discrete chained images without motion interpolation. The GIF node documents timing and output behavior.

For controlled frame edits, choose frame_source=original and frame_seed_mode=fixed; each pose then starts from the same reference and noise. Chroma, HiDream and Qwen each have an image-to-image-gif-masked variant with an adjustable soft edit rectangle. Qwen’s GIF paths re-encode the preceding decoded image in the native instruction-based edit encoder when frame_source=previous; original mode keeps the initial reference for independent edits. Identical first/last pose prompts provide a controlled loop boundary with original-reference/fixed-noise sampling. These workflows still require visual motion evaluation.

For Qwen animation, start with qwen-keyframe-edit or qwen-keyframe-sequence. Both edit a crop independently from the shared original, then feather the edited crop onto the original scene. The crop’s X/Y controls also position the composite; include the old and desired hand positions inside the crop. The separate movement rectangle controls which part of that crop is blended back; include both old and intended hand positions inside it, away from its feathered boundary. Qwen receives only the crop as its image reference. The crop is sampled without a latent noise mask. The raw crop and final PNG are both saved for inspection. Original scene pixels outside the movement area are retained before image encoding, but the workflow cannot guarantee a correct pose or alignment inside it. Reject edits that cross or misalign with the mask.

The initial crop/full-scene-reference trial produced redraw and seams. A later single-reference localized press with a narrower composite was steadier; a precise hand lift remained unreliable. These are inspectable still-edit tools, not a validated natural-petting animation preset.

For rough-pose repair, use qwen-pose-guide-edit: image 1 is a roughly composed target frame and image 2 is the original appearance reference. Supply equally sized, aligned images with only one hand in the guide. The prompt assigns pose to image 1 and appearance to image 2. The guide is scaled to about one megapixel with its aspect preserved and dimensions rounded to eight-pixel steps. Sampling starts at denoise 0.7 to retain visible guide geometry. The guide determines the sampling canvas; the output is restored to the original dimensions, and a feathered region is composited onto the original. Shared X/Y and width/height controls keep the crop, composite and mask matched; the region must include old and target poses plus the exposed background. Inspect both the full repair and composite. This supplies visible geometry but does not enforce the pose or temporal consistency. Evaluate a single repaired pose before producing a sequence.

The four-edit rough-pose trial preserved a lifted hand and improved its anatomy at denoise 0.7, but retained rough background placeholders. Full-denoise repair returned to the original contact pose; reversing the reference order produced a waving gesture. A separate background-only masked repair removed most gray fill while preserving all pixels outside its mask, but left a cutout artifact and changed the plush top. No finished frame or GIF passed visual acceptance. Avoid large flat placeholders in guides; repairing anatomy and rebuilding vacated background may require separate, independently inspected edits.

A later photographic-guide trial uses image-editor-prepared background/hand layers and FFmpeg to construct target poses, then refines every selected pose with Qwen and interpolates with RIFE. Increasing the guide’s hand travel from 14 to 154 pixels makes the movement visible. Five inspected Qwen poses produce a 64-frame loop, but the forearm still deforms unnaturally and textures vary. Lowering denoise from 0.7 to 0.45 removes an extra digit in one pose but does not repair another pose’s artificial skin texture. These are case-specific findings, not new defaults or a validated natural-animation preset. Guide preparation is a separate image-editing step; the complete process is not solely Qwen and RIFE.

For structural references, first use qwen-sketch-reconstruction with a coherent target sketch as image 1. It produces a raw full-frame reconstruction from that single reference. Then use qwen-structure-guide-edit: image 1 remains the sketch and image 2 adds the original appearance photograph. Both graphs share the prompt, blank negative text, seed 42, 40 steps, CFG 4 and full denoise. Both retain normal native semantic and VAE reference conditioning on both branches. The sketch determines the sampling canvas. Compare raw outputs to distinguish sketch comprehension from competition with the appearance reference.

The structural-reference workflow also restores the original dimensions and saves an optional feathered composite onto the original. Inspect its raw output first. Earlier exports used the opposite reference order; import the corrected graph and assign the inputs using their titles. Native conditioning has no separate ControlNet strength and does not guarantee pose or identity preservation. Use the prepared sketch and comparison procedure.

The earlier structural-reference trial followed the moved-hand outline closely, but raised the plush into the palm instead of preserving a gap. Full-scene edges introduced a dark smear; geometry-only conditioning lost the pose, and a white sketch produced a doubled hand. None of the four outputs passed finished-frame acceptance. This remains an experimental guide workflow; no usable petting GIF was obtained. Subsequent input review found conflicting head contours in the scene sketch. In the corrected-guide GPU trial, the sketch-only default reconstructs a clear hand gap and a coherent scene. Adding the original photo restores its appearance but introduces unwanted crown folds. These results demonstrate useful guidance, not a finished petting animation.

Inspect each pose before loading selected, equally sized PNGs into qwen-keyframe-gif. This model-free workflow combines three approved poses, optionally reverses them back to the first pose, and uses the existing RIFE engine at 1x (disabled), 2x, 4x or 8x. Reversal closes the loop; interpolation smooths accepted poses and cannot repair malformed hands. The assembly node also accepts any native IMAGE batch of 2 to 128 keyframes. Each input is retained as a PNG. The older chained Qwen GIF workflows remain available for comparison.

The image-generation Ansible deployment packages the selected node sources and workflow files through Bazel and installs them with the shared comfyui_tools role. This project does not own the upstream ComfyUI CLI, server image or infrastructure state.

bazel test //projects/comfyui_tools/nodes/prompt_sequence:prompt_sequence_test
bazel test //infra/image_gen/tf_setup:tf_tests.test_test

These checks exercise node behavior and Terraform’s packaged workflow inputs. The node uses the standard ComfyUI editor without a custom browser extension. They do not access a rental or establish compatibility with its frontend version or GPU image quality.

The experiment runner maintains a configurable owned job buffer on an existing endpoint. External producers supply arbitrary native workflows and meaningful variations. It preserves original media, workflow snapshots, hashes and a resumable private journal, with no instance lifecycle operations. The ComfyUI experiments skill covers queue observation, feedback and result review.

The evaluator runs independent, bounded rental workloads using the existing Vast SDK and ComfyUI CLI. Reusable cases include the supplied thorn-landscape artwork prompt/reference and the plush-petting GIF reference. Infrastructure composition owns the run matrix, credentials, limits and final/manual cleanup targets. No personal Terraform state is read or changed. All executable code stays in this project.

Matrix groups expand hardware/model/workflow/case coordinates. All compatible workflows, cases and seeds sharing a hardware/model profile reuse one rental. Each rental starts as soon as its own endpoint is ready, keeps native jobs queued ahead of retrieval and releases capacity as soon as all its configured outputs are downloaded. Local media validation follows deletion. Inputs, native workflows, fixed seeds, model definitions, timings, output hashes and cleanup status are retained in private run artifacts. Artistic quality and reference adherence remain separate, unscored review criteria; execution success is not a quality verdict.

For repeated iterations, retain the first run with --cleanup=false, then pass --reuse-run /absolute/path/to/that/run --cleanup=false. Reuse requires matching declared installations, recorded provisioning fingerprints and exact live ownership; it never allocates a fallback. Fingerprints cover installed node source and requirements contents, runtime settings and the startup template. Runs without fingerprints cannot be reused. Each iteration records new cases, workflows and sampling in a separate result directory while preserving the original instance and prior results. Retention continues billing outside controller deadlines; release requires explicit cleanup.

Loopback E2E checks exercise matrix pooling, offer reuse, namespace exclusion across output directories, duplicate-seed rejection, parallel completion, failures, interruption, lost creation acknowledgments, cleanup recovery and the real authenticated CLI’s upload/conversion/native-queue/download path, plus descendant cancellation. They never rent capacity or prove GPU model quality. Runtime composition currently supports the maintained CLIPTextEncode-based SDXL and HiDream graphs; unsupported workflow bindings fail before allocation. The authenticated CLI bridge requires Linux procfs.

1 - Buffered ComfyUI experiments

//projects/comfyui_tools/cmd/experiments runs arbitrary workflows against an existing endpoint through the native ComfyUI CLI. It maintains one executing job plus a configurable pending buffer after warm-up, independently observes completion and downloads original media. It does not provision instances, install models or manage credentials. The caller supplies an authenticated CLI and a producer containing a finite set of ready candidates. The experiment skill owns the direction, evaluation, scrap/refine/fork procedure. Queue buffering schedules ready work; it does not evaluate outputs or authorize endless successor generation.

Build the executable and any launchers before starting the sustained process:

bazel build //projects/comfyui_tools/cmd/experiments
bazel-bin/projects/comfyui_tools/cmd/experiments/experiments_/experiments \
  run --config /absolute/task/config.json --directory /absolute/task/run

The runner requires Linux process groups and advisory file locking. Child commands receive literal argv without shell expansion and inherit the caller’s environment. Use absolute paths for executable wrappers and all inputs. Do not start nested bazel run children beneath a long-lived Bazel invocation; build first or prepare a --script_path launcher. Live runtime commands need network access; builds and E2E fixtures do not.

{
  "cli": ["/absolute/authenticated-comfy"],
  "producer": [
    "/absolute/workflow-producer",
    "--matrix",
    "/absolute/matrix.json"
  ],
  "queued_buffer": 2,
  "max_experiments": 12,
  "timeout_seconds": 3600,
  "duplicate_attempts": 8
}

For a separately and explicitly authorized continuous stream, replace max_experiments with "continuous": true. The two modes are mutually exclusive. Iterative direction development uses finite runs and review before successor jobs; an earlier utilization request does not select continuous mode. Buffer defaults to two pending jobs, timeout to 3600 seconds per subprocess operation, and duplicate attempts to eight. The timeout includes native queue waiting; allow enough time for the configured lookahead. Native execution can continue after a local timeout or interruption.

The producer receives one JSON object on stdin:

{ "sequence": 0, "directory": "/absolute/task/run/000000" }

It writes exactly one JSON object on stdout, with diagnostics on stderr:

{
  "workflow": "/absolute/task/run/000000/candidate.json",
  "description": "Compare raking light with the earlier diffuse-light composition",
  "identity_exclusions": ["/7/inputs/seed", "/10/inputs/filename_prefix"],
  "notes": {
    "positive_prompt": "A geometric still life in raking light",
    "negative_prompt": "blur"
  }
}

The workflow is a native UI or API JSON object, at most 64 MiB. The producer owns model bindings, parameters, reference files, prompts and batch size; no such fields are hard-coded into the runner. Return {"done":true} to end the stream gracefully. Sequence numbers are monotonic requests, including rejected duplicate candidates, rather than counts of accepted jobs.

Stop is rechecked after a producer returns and before submission, so a drain requested during a slow producer does not add another job.

The runner snapshots exact workflow bytes before submission. Duplicate identity is canonical JSON after removing explicitly declared JSON-pointer fields. Object fields are removed; array positions become null so indexes do not shift. Every pointer must exist; root exclusions are forbidden. Exclude seeds, output prefixes and irrelevant UI bookkeeping consistently. Keep meaningful parameters in the identity. This detects declared structural duplicates; the producer and agent still assess useful semantic variation.

The private run directory contains journal.json, a single-controller lock, per-experiment native receipts and workflow snapshots, original media/, and gallery.html with collapsed notes, prompts, settings and hashes. Journal decoding supports the records its writer can produce, including journals larger than 64 MiB. Opaque numeric notes retain their exact JSON values through execution, restart and report generation. Directory permissions are restricted to the current account. CLI captures are bounded and raw diagnostics never enter the gallery. Inspect inputs and notes for protected data before sharing any artifact.

experiments status --directory /absolute/task/run
experiments stop --directory /absolute/task/run
experiments stop --directory /absolute/task/run --cancel-owned

stop writes a control request for the running controller to drain. Explicit --cancel-owned additionally targets only recorded outstanding prompt IDs through native jobs cancel; an idle run consumes the request when resumed. Cancellation is reconciled against the exact native job status: a rejected interrupt retains ownership, and a job that completed before cancellation retains artifact collection. A successful cancel command alone is not proof of termination. No operation clears the global queue or changes an instance.

SIGINT/SIGTERM stop local subprocess groups and preserve remote jobs. Resume with the same configuration and directory. Recorded prompt IDs are observed again without resubmission. A durable successful submission receipt can recover an ID after interruption before journal update. A missing acknowledgment is recorded as submission_unknown and prevents automatic new submissions. Inspect the private receipt and endpoint before any manual reconciliation. A valid successful CLI envelope followed by a wrapper cleanup error retains the acknowledged result and sets cleanup_warning; it is never blindly resubmitted.

Retrieval transport failures get at most three attempts, with one- and two-second delays and fresh artifact directories; generation is never resubmitted by those retries. Invalid or escaping media is rejected immediately.

Producer, native job and exhausted artifact failures stop replenishment and retain failure phases for inspection. Observer transport errors and timeouts retain the owned ID in observation_failed, so restarting can observe it again or apply an owned cancellation request. These errors do not establish a terminal native outcome. Confirmed failure and cancellation summaries in unsuccessful wait envelopes remain terminal across restart. A new configuration needs a new run after owned work has been reconciled; do not use a new directory to evade an ambiguous submission. Control requests persist, including across restarts.

queued in the local journal means submitted and awaiting a terminal native observation. It does not distinguish executing from pending or establish GPU utilization. Observe the endpoint for that distinction. Slow producers, authentication, endpoint outages or insufficient lookahead can still exhaust the buffer. Original outputs and execution success do not establish visual quality, text accuracy or reference fidelity.

bazel test //projects/comfyui_tools/test/experiments:experiments_test

Command-level fixtures verify buffering during slow downloads, seed-only duplicate rejection, restart without resubmission, concurrent-controller exclusion, lost acknowledgments, explicit producer exhaustion, cleanup errors, owned cancellation, failed jobs and escaping media. They emit JSON receipts under Bazel’s undeclared test outputs. They use no live endpoint, credentials or rentals. The agent skill covers useful variations, feedback, queue observation and visual review.

2 - Chained image to image GIF

This output node uses native ComfyUI sampling and VAE decoding to create one frame for each Prompt Sequence line. Each decoded frame is VAE-encoded as the input to the next frame. The initial image is a starting condition, not an extra frame. Negative conditioning and sampling settings are shared. frame_source selects the previous decoded image or the original reference for each frame; frame_seed_mode selects incrementing seeds or fixed noise. Saved nodes without these controls retain previous-frame feedback and incrementing seeds. Original reference plus fixed noise reduces accumulated drift and makes identical first/last prompts suitable for a controlled loop boundary. Neither control supplies a motion trajectory. Start with denoise 0.45, 40 steps and 6 fps for full Chroma.

The complete chain is one dependent queue job. Ordinary panel sequences also stay in one job to keep their media grouped. GIF frame prompts describe successive changes to the same scene; this is discrete img2img chaining, without motion interpolation. Lower denoise preserves more of the preceding frame; higher denoise changes it more. GIF uses a 256-color palette per frame and frame intervals rounded to 10 milliseconds. All frames are retained, including identical adjacent frames. The GIF is assembled inside the ComfyUI output node and uses its native animated preview. No external assembly step is required.

The image-to-image-gif-masked workflows add native ComfyUI masks so only an editable rectangle receives denoising. Adjust its size, position and feathering around the intended moving subject. Eval cases own their rectangle in output pixels. Qwen’s GIF workflows condition every frame on the selected image through its native image-edit encoder; they start at denoise 1, CFG 4 and 40 Euler/simple steps.

The node uses Torch, NumPy and Pillow already installed by ComfyUI. It does not download software. A single initial image is required. Sampling errors and interruptions do not publish a partial GIF. Files use native output naming, stay within the output directory and never overwrite an existing GIF.

Frame decoding uses ComfyUI’s native VAEDecode normalization, including Qwen’s single-frame temporal VAE output. CPU frames are converted to float32 for NumPy/Pillow encoding. This compatibility path is covered by the real-GIF fixture; successful GPU generation remains separate acceptance.

The separately packaged Qwen GIF node consumes raw frame instructions, a Qwen text encoder and the initial image. In previous-frame mode it feeds each decoded result through the native Qwen image-edit encoder for the next positive/negative conditioning, and through VAE encoding for that frame’s sampler input. This remains genuine image feedback at denoise 1. The original-reference control remains available for independent-edit comparisons. The existing generic node retains its saved-input interface.

3 - ComfyUI workflow nodes

This package owns the Prompt Sequence implementation, its native multiline text box and offline checks. In line mode, each nonempty line is one panel; blank and whitespace-only lines are ignored. Terraform stages its Python source through the existing native ComfyUI provisioner; the repository Python library is only for offline checking. One optional multiline negative prompt is shared across every panel without splitting or adding the positive context. It is appended to the existing inputs; the third output is scalar text, while prompt and filename outputs retain their original list slots. Existing four-input workflows remain accepted with an empty negative output.

One Run stays one native ComfyUI job, so its outputs stay grouped in media. Every run gets a fresh UUID prefix, for example comic_5ba8d9cae1374e90aeed4482cf57841c_001; the remaining panels use the same UUID and increasing suffixes. Unchanged text queued again creates a new run identity rather than reusing cached output filenames.

Current sequence workflows pass their model through the node’s optional MODEL input/output. A wrapper on a cloned native model patcher displays Panel 2 of 3 as native sampler progress text while the sampler’s step counter continues to work. Sampling and conditioning are unchanged. Older graphs retain their first three output slots and still work; import the current workflow to add the model connection required for panel progress. No browser extension is installed. See the workflow instructions for panel input and the boundary between shared references and panel continuity.

4 - Image sequences

Image Sequence generates ordered still images in one ComfyUI job. Each scene starts from fresh noise. Further actions edit the previous decoded image, while the graph’s original IP-Adapter references remain active. It saves each completed PNG immediately, before starting another action. Cancellation leaves completed files in ComfyUI’s output directory.

Use one complete desired-image prompt per line, with --- alone on a line to start a new scene. Blank lines provide spacing and do not create images. Scene breaks reset composition, not references or shared appearance text. NoobAI is a tag-oriented generator: describe the desired result rather than writing only an edit command such as “move the hand”.

Sequence References provides one required appearance reference, two optional views and an optional continuation image. (none) omits an optional input. Reference views are fitted inside 512-square canvases with edge padding, preserving their full contents. All references influence the whole image; this is not per-character region assignment. Continuation retains its original pixels until the sampler resizes it to the requested canvas.

For a partial run, keep the complete action list, set start_image to its absolute action number and image_count to the wanted number (0 means all remaining). Starting inside a scene requires its accepted preceding image in continuation. Starting at a scene boundary ignores continuation and creates a fresh composition. The seed is the base seed plus the absolute action index, modulo 2^64. Keep the seed control fixed to repeat a run; extending the list does not change earlier action seeds. Inserting or deleting earlier actions changes later indices.

Change strength starts at 0.45. Lower values retain more composition; higher values allow larger changes. Scene starts always use 1.0. References reduce appearance drift but do not guarantee identity, anatomy or action fidelity.

Each PNG includes the native workflow/prompt metadata and an image_sequence record of its actual scene/action, seed, effective prompts and sampler settings. Filenames share a fresh run identifier and contain ordered scene/action numbers. The native App gallery receives all completed results when the job finishes; files from interrupted runs remain on disk even when the job has no final gallery.

After the run finishes, one combined GIF plays all generated images in action order. The App exposes gif_frame_duration_ms, initially 500 milliseconds per image; values from 20 to 10000 in multiples of 10 are accepted. PNGs and GIFs share the run identifier. GIFs use the already-saved PNGs, keep their dimensions and add no intermediate motion when interpolation is disabled. Identical adjacent images can share an encoded frame with a combined hold time. Partial runs contain only their newly generated images. Per-scene GIFs are not published. Interruption preserves completed PNGs and does not publish an incomplete GIF. The native gallery includes the stills and the combined animation.

Optional control_net receives the approved NoobAI Canny model. Within a scene, native Canny extracts edges from the resized preceding image and native ControlNet conditions both positive and negative prompts. control_strength defaults to 0.35; zero disables it. control_end defaults to 0.8. Scene starts skip this guide. Lower the strength for larger pose changes; edge guidance can resist them and does not guarantee identity or temporal consistency.

interpolation_multiplier accepts 1 (disabled), 2, 4 and 8. The App defaults to 4x and requires the configured Video2X 6.4.0/RIFE 4.25 installation and Vulkan device. RIFE smooths each scene separately; the combined GIF retains hard scene cuts. Scene playback duration is preserved with GIF’s 10-millisecond precision. The original PNGs remain untouched. Interpolation can distort inconsistent poses. Native cancellation also stops interpolation and its child processes, removes run-owned temporary media and retains completed PNGs.

The separate noobai-reference-sequence preset retains this reference/continuation behavior, with Canny and smoothing disabled initially for inspection. The noobai-scene-composer preset uses the same sampler/output node with generation_mode=independent, seed_mode=fixed, 25 first-pass steps and 20 refinement steps at denoise 0.4. Every first pass starts from fresh noise; its second pass consumes only that image’s sampled latent, with the same seed and conditioning. Zero refinement steps disables the second pass. The legacy node defaults remain previous-image generation, incrementing seeds and no refinement.

Scene Prompts combines fixed character, clothing and style descriptions with one setting per scene and one action per line. A single setting applies across all scenes; any other count mismatch fails before sampling. --- still groups scenes for settings and hard playback cuts. An independent partial run needs no continuation image. The composer has no image-reference adapter or edge control.

Optional LoRA defaults to (none) and passes the model/CLIP pair unchanged. Selecting an already-installed filename delegates to native LoraLoader with separate model and text-encoder strengths. No model is downloaded. Shared tags, fixed seeds and refinement do not guarantee character identity or better quality.

The NoobAI workflow instructions describe importing the generated App. The runtime source is staged as one native custom-node module. Interpolation additionally uses the repository-pinned Video2X installation managed by the infrastructure owner.

ImagegenKeyframeGIF assembles an approved IMAGE batch without loading a model. Use 2 to 128 equally sized poses, a frame duration divisible by 10 ms and an interpolation multiplier of 1, 2, 4 or 8. Reversible playback traverses the poses and returns to the first, allowing RIFE to smooth both directions. The node retains each source as a PNG and publishes one looping GIF using the same writer as image sequences. Interpolation requires the deployment’s existing Video2X engine. Validate the poses first; neither reversal nor RIFE fixes incorrect edits.

5 - Image-generation evaluation cases

Each case owns its prompt, supplied reference and review criteria. The operator approved publishing both cases and their assets. Both reference files retain their original operator-supplied bytes.

The thorn case depicts a forbidden burial ground of monumental artificial thorns and one visibly impaled, flesh-covered adult corpse. Its reference guides architectural form; the text directs a low viewpoint, asymmetric silhouettes, selective painterly edges and harsh raking light. The architecture dominates, while a legible chest wound, dead face and hanging posture provide a shocking second reading. Emotional intensity has its own review criterion; darkness and detail alone do not establish it. A skeleton or bare skull fails subject adherence. Compare text-only and reference-guided results with the same seeds.

The plush case requests visible petting motion and a seamless loop. Frame prompts describe successive static hand poses, with identical first and last poses. Its edit_region selects the hand area for masked comparisons. The matrix compares chained feedback, original-reference sampling and native Qwen editing; it does not imply a trained video model or guarantee smooth motion. Its sketch comparison provides a corrected structural input and a staged sketch-only/appearance-reference procedure. This separate diagnostic does not run as part of the existing GIF matrix.

Execution, media validity, timings and cleanup can be checked automatically. Review requested subject, style, reference adherence and artistic quality separately on a 0–4 scale: absent, weak, partial, mostly achieved, consistently achieved. Leave unreviewed scores null. Valid files are not quality acceptance.

Deployment configuration and credentials belong to infra/image_gen/evals. Generated outputs and reports belong to the configured ignored output directory.

5.1 - Plush petting sketch comparison

reference.jpg retains the original operator-supplied photograph. lift-sketch.png is a prepared structural input with one continuous head outline and a visible gap beneath the entire raised hand. The sketch is not a Qwen output or a successful animation frame. It simplifies some details and is not a pixel-aligned mask for the original photograph.

Use these inputs in order:

  1. Upload lift-sketch.png and open qwen-sketch-reconstruction. Run the default full-strength reconstruction and inspect the raw PNG. Reject contact, a second hand, a second crown, disconnected anatomy or a different scene layout.
  2. Once that baseline succeeds, upload reference.jpg and open qwen-structure-guide-edit. Image 1 remains the same sketch; image 2 adds the original appearance. Keep prompt, seed, negative text and sampling settings identical to the baseline. Compare QwenStructureGuideRaw with the baseline before looking at the optional composite.
  3. If only the second run fails, investigate reference competition. If the baseline also fails, investigate sketch reconstruction before producing a sequence. A successful file or graph execution is not visual acceptance.

The checked-in graphs share the default prompt and sampler configuration. Edits made separately after import do not synchronize automatically. The baseline requires only the sketch; both retain native semantic and VAE image conditioning on positive and negative branches. The appearance workflow also restores original dimensions and produces a feathered composite using the existing repair rectangle. Adjust that rectangle to cover the complete movement; compositing cannot repair pose drift, differing outlines or changed framing.

The built-in image generation editor prepared this input on 2026-11-16 using the exact asset preparation prompt. Its input was the white-background scene sketch from the rejected native-reference trial, SHA-256 81ce3fbee43e508b5caa510de445fe5c893eaf8355ec797ffb6c5567bef1d36f. That source combined native Canny edges from the public photograph with moved hand contours and an added crown curve. Inspection found a conflicting retained outer hair contour; the repaired asset removes that ambiguity. The trial record retains its lineage and failed Qwen outputs.

The repaired asset is an opaque RGB PNG, 1297 by 1213 pixels, SHA-256 c19aa520a4cc2ee4c809921bd639a3987bcbbb93927958ad71e6fa037610176c.

Visual inspection confirms a single connected forearm/hand silhouette, one rounded crown and a continuous gap. The native Qwen trial records the subsequent GPU comparison: the default sketch-only reconstruction retains the gap and coherent anatomy, while adding the original restores its appearance but introduces unwanted crown folds. Preserve the two variants and compare them at identical settings. Neither command success nor the improved still establishes a finished animation.

The same trial also tests this targeted negative text with the original positive prompt unchanged in both variants:

animal ears, raised ear-like folds on the plush's head, horns, hats, cushions above the hair

It retains a clean sketch-only reconstruction but does not remove the folds with the original appearance reference. It is a recorded experiment, not the default or a verified correction. The saved workflows retain editable negative prompt fields and the original blank default.

The default prompt describes the supplied lifted-hand sketch. For a contact or pressing guide, replace its hovering and air-gap instructions with the contact, finger curvature and head compression shown in that guide. Keep image 1 as the target geometry and image 2 as original appearance. An unchanged example prompt can contradict a new sketch.

Approve the sketch motion before reconstructing its distinct poses. Inspect the raw photographs before optional compositing or interpolation: the contact-pose trial preserves hand placement but changes finger arrangement and portal texture between frames. The existing rectangular composite can introduce seams. Fixed seeds and shared appearance references do not guarantee temporal stability.

Photographic pose guides are another input to qwen-pose-guide-edit: prepare a clean background and a separate hand layer, place the hand at each target pose, then refine each guide with the original appearance reference. This preparation is separate from Qwen sampling. In the visible-motion trial, the image editor prepares the layers and FFmpeg positions them. The earlier drawn sketch is not an input to that trial.

The trial keeps seed 42, 40 Euler/simple steps, CFG 4 and blank negative text. Start by comparing the lifted and pressed raw outputs at denoise 0.7; the instruction must preserve either a gap or contact according to the current guide. Lower denoise can retain more of the guide, including its defects: 0.45 removes one extra digit but fails to fix a separate skin-texture artifact. Inspect all poses and omit rejected outputs before RIFE assembly. Larger movement exposes the hand-layer warp’s unnatural forearm shape, which Qwen can preserve. The resulting loop demonstrates visible motion, not stable natural anatomy.

6 - Qwen chained image to image GIF

This node refreshes Qwen’s positive and negative image-edit conditioning from each preceding decoded image, and VAE-encodes those same pixels for the next frame. The shared chained_img2img_gif node owns sampling, decoding, progress and GIF publication. Both first-party node directories must be enabled; the native registry resolves the shared node when the workflow is inspected or run, so custom-node import order does not matter.

Only Qwen evaluation rentals install this model-specific node. Other models retain the shared renderer without carrying Qwen code in their startup payload. This uses ComfyUI’s installed native Qwen encoder and adds no external package. The shared real-GIF fixture exercises its reference and latent feedback.