Repository navigation
feat: validate workflow model references before submitting to ComfyUI - #241
Merged
lukepiette merged 1 commit intoSep 21, 2026
Merged
lukepiette merged 1 commit into
lukepiette merged 1 commit into
Conversation
Workflows referencing checkpoints/LoRAs/VAE/CLIP/UNet weights that are not on the worker previously failed only after the cold start and submit, with ComfyUI's cryptic "Value not in list" / prompt_outputs_failed_validation errors. Some clients also send the literal '__list__' UI placeholder as a model name. Add a pre-flight check in handler() that walks the workflow graph before queue_workflow() and validates every known loader node's model input against ComfyUI's /object_info. All missing files are collected into one clear error naming each file, its model type, and the expected network volume directory; the '__list__' placeholder gets a specific message. Matching is case-sensitive (mirroring ComfyUI) with a did-you-mean hint on case-only mismatches. If /object_info can't be fetched the check is skipped (fail open) and queue_workflow()'s existing 400 enrichment remains as the backstop. get_available_models() is generalized from CheckpointLoaderSimple-only to all known loader node types. Also repairs tests/test_handler.py, which no longer imported (handler.py moved to the repo root) and tested functions that no longer exist; CI tests are currently a placeholder so this had gone unnoticed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Real-GPU validation (Runpod secure-cloud A40, real ComfyUI server with SD1.5-fp16 on disk):
🤖 Generated with Claude Code |
lukepiette
marked this pull request as ready for review
September 21, 2026 21:40
OWCramer
approved these changes
Sep 21, 2026
Promptless documentation updates
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a pre-flight validation step that checks every model file a workflow references against ComfyUI's
/object_infobefore the workflow is submitted — so a missing checkpoint/LoRA/VAE/CLIP/UNet (or the literal'__list__'placeholder some clients send) fails fast with a clear, actionable error instead of a cold start followed by a cryptic crash.Before / After
Before: the worker cold-starts (often ~20 min pulling models), the workflow is submitted, and ComfyUI rejects it with
Value not in list: ckpt_name,Invalid image file: /runpod-volume/..., or a bareprompt_outputs_failed_validation. The existing 400-handling inqueue_workflow()enriched only the checkpoint case (CheckpointLoaderSimple), missing LoRAs, VAE, CLIP, UNet, upscale models, and the'__list__'placeholder entirely.After: the handler validates the workflow right after image upload and before
queue_workflow(), and returns one error listing every missing file, its model type, and the expected network-volume directory:The
'__list__'placeholder gets its own message explaining the client sent a UI default that was never replaced with a real filename.Design decisions
/object_info(what ComfyUI actually has registered — authoritative, covers baked-in and volume models alike). The expected-location hint maps model types to the volume layout fromsrc/extra_model_paths.yaml(text encoders →models/clip/, diffusion models →models/unet/).AGENTS.md:CheckpointLoaderSimple,LoraLoader,VAELoader,DualCLIPLoader/TripleCLIPLoader,UNETLoader/UnetLoaderGGUF/Hy3DModelLoader,UpscaleModelLoader, plusLoadImage(theInvalid image filecase).subdir/file.safetensors) compare against the same relative form/object_inforeturns./object_infocan't be fetched, the pre-flight is skipped and the existingqueue_workflow()400-enrichment remains as the backstop — a network blip is never misreported as a user error. Loader node types not registered in the running ComfyUI build are skipped rather than guessed at. AnnotatedLoadImagerefs (file.png [output]) are also left to ComfyUI.get_available_models()is generalized from checkpoint-only to all loader types;queue_workflow()'s existing backstop behavior is unchanged.Test suite repair (pre-existing breakage)
tests/test_handler.pydid not import onmain(from src import handler— handler.py lives at the repo root) and several tests targeted functions removed in #118 (base64_encode,process_output_images, the old urllib-basedqueue_workflow/get_history). CI's test job is currently anechoplaceholder, so this had gone unnoticed. This PR repairs the suite: fixed imports, updated stale tests to the current signatures, removed tests for functions that no longer exist, and added coverage for the new pre-flight.Validation
python -m unittest discover tests -v→ 28 tests, all passing (onmainthe suite fails at import). New coverage:queue_workflow()unchanged'__list__'→ specific placeholder message["7", 0]) and unregistered loader types → skipped/object_infounreachable → fails open (no error)queue_workflow()is calledNote per
AGENTS.md: handler.py isADDed into the image at build time (no hot reload) — logic validated via unit tests as recommended there.🤖 Generated with Claude Code