Repository navigation
fix(inference): reject a missing negative_prompt_file and flag more Transfer settings that cannot take effect - #354
Open
rwagwani wants to merge 3 commits into
Conversation
…d negative-metadata settings Follow-up to NVIDIA#338. - negative_prompt_file is validated when the sample is parsed. A relative path resolves against the spec file's folder (as vision_path and prompt_path do), and a bare filename under defaults/ is still accepted. A path that does not exist now fails before model load, instead of passing silently whenever a default negative_prompt wins. - negative_metadata_mode and negative_prompt_keep_metadata join the distilled causal Transfer ignored-fields table (neutral values: none / false). No change to which negative caption is used, so cookbook and Sim-Transfer skill outputs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ddress review - Resolve a relative negative_prompt_file from the launch folder first (where it was read from before), then the spec's folder; a defaults-file entry is also tried next to that defaults file. - Apply the defaults/ fallback to a bare filename only. - Check negative_metadata_mode against the requested value, so a keep_metadata promotion of 'none' to 'same' does not warn. - Update a stale comment in transfer_shipped_specs_test.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while validating the blur and edge controls of Cosmos3-Nano-Sim-Transfer: - warn when an edge/blur preset other than the default is set next to a control_path, which is used as-is so the preset is never read; - warn when show_input is set without vision_path (no input video to show); - validate the chunk partition only on the chunked path, so the causal path no longer rejects num_conditional_frames >= num_video_frames_per_chunk, which it never reads; - accept resolution given as an integer (480 -> "480"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: root <root@pmgb300ws-0350.ipp9c1.colossus.nvidia.com>
rwagwani
force-pushed
the
fix/transfer-negative-file-and-metadata
branch
from
November 4, 2026 14:02
466ecdd to
9cfff2c
Compare
This branch has not been deployed
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.
Follow-up to #338, covering the two items it listed as not covered, plus four more Transfer settings found while validating the blur and edge controls of Cosmos3-Nano-Sim-Transfer.
Summary
A missing
negative_prompt_fileis now rejected when the sample is parsed, before the model loads. Before, the file was read only when nonegative_promptwas set; in almost every setup a defaultnegative_promptwins first, so a typo in the path was accepted with no message. Lookup order:../assets/negative_prompt.jsonlayout);defaults/(for exampleneg_prompts.json).A
negative_prompt_fileinside a--defaults-fileis also tried next to that defaults file. A path that is not found fails with:negative_metadata_modeandnegative_prompt_keep_metadatawarn on distilled causal Transfer. They are added to_DISTILLED_TRANSFER_IGNORED_FIELDS, with neutral valuesnoneandfalse, so a request that sets them gets the same[transfer] '<field>' is ignored by distilled causal Transfer: ...warning as the other fix(inference): warn when a transfer setting cannot take effect #338 fields. The distilled schedule has no negative-caption branch, so neither setting is read.A preset next to a
control_pathnow warns.load_transfer_control_framesuses acontrol_pathas-is and computes the edge/blur control fromvision_pathonly when there is nocontrol_path, soblur.preset_blur_strength/edge.preset_edge_thresholdare never read in that case. A non-default preset set by the request now logs[transfer] 'blur.preset_blur_strength'='very_high' is ignored: 'blur.control_path' is set, ....medium(the default, and the value in the shipped cookbook specs) stays silent.show_inputwithoutvision_pathnow warns. There is no input video to put next to the output, so single-view Transfer writes the output alone with no message. Ashow_input=trueset by the request, with every control coming from acontrol_pathand novision_path, now logs[transfer] 'show_input' has no effect without 'vision_path': ...(streaming Transfer already rejects this request).num_conditional_frames>= the chunk size no longer stops the causal path.generate_transfer_samplecalled_get_num_chunksbefore branching, sonum_conditional_frames=2withnum_video_frames_per_chunk=1failed after model load with "num_conditional_frames must be smaller than num_video_frames_per_chunk", even though the causal path never reads either value and fix(inference): warn when a transfer setting cannot take effect #338 already reports both as ignored on distilled checkpoints. The chunk partition is now validated only on the chunked (bidirectional) path, which is unchanged.resolutiongiven as a number is accepted."resolution": 480in a JSON spec failed the Literal check (input_type=int); a before-validator onVisionDataOverrides.resolutionturns an integer into its tier string. Values outside the tiers (1080,"4k") and booleans are still rejected as before.Not changed
Behaviour change, stated plainly
negative_prompt_file, and it lists every path it tried. Every shipped cookbook spec and Sim-Transfer skill request still builds;transfer_shipped_specs_test.pycovers this.--defaults-file. A setup that carried an unused, broken path now fails, by design.vision_path, so--skip-invalid-samplesdoes not skip it.num_conditional_frames>= the chunk size on the causal path, and withresolutionas an integer, used to fail and now run.negative_metadata_modeis checked against the value the request set, sononedoes not warn whennegative_prompt_keep_metadatafrom the defaults promotes it tosame.Verification
sim_transfer_args_test.py:defaults/filename is still accepted, but a path such astypo_dir/neg_prompts.jsonis notnegative_metadata_modewarningnegative_metadata_modenone/same/inverseandnegative_prompt_keep_metadatafalse/truewarn only for non-neutral valuessim_transfer_args_test.py: the preset warns for a non-default value withcontrol_path(blur and edge) and stays silent formedium, for no preset, and withoutcontrol_path;show_inputwarns only when the request set it and there is novision_path; integer480/720are accepted,1080,"4k"andTrueare still rejected.transfer_test.py: the causal path runs withnum_conditional_frames17 and 30 against a 17-frame chunk, for distilled and non-distilled checkpoints;_get_num_chunksstill rejects it for the chunked path.test_unused_negative_prompt_file_is_not_openednow uses a file that exists, because a missing path is rejected earlier. It still checks that the file is not read when a default caption wins. A stale comment intransfer_shipped_specs_test.pyis updated.pytest cosmos_framework/inference/sim_transfer_args_test.py cosmos_framework/inference/transfer_shipped_specs_test.py cosmos_framework/inference/args_test.py: 159 passed.pytest cosmos_framework/inference/ -m "not GPU": the same 7 failures as main (auto_rig_frontend_testx1,model_testx6), no new ones.neg.json, with the spec elsewhere, still resolves to the launch folder's file.ruff checkandruff format --check: clean.pytest -m CPU cosmos_framework/data cosmos_framework/inference: 1038 passed, 0 failed;sim_transfer_args_test.py,transfer_test.py,args_test.py,transfer_shipped_specs_test.py,transfer_direct_resize_test.py: 306 passed; pre-commit (base and full config): clean.negative_prompt_file: "missing_negative.json"was accepted silently before. Now it stops before model load with the message above.negative_prompt_filestill runs, with an unchanged result, and logs[transfer] 'negative_prompt_file' is ignored by distilled causal Transfer: the distilled schedule has no negative-caption branch.negative_metadata_mode: "same"runs, with an unchanged result, and now logs[transfer] 'negative_metadata_mode' is ignored by distilled causal Transfer: the distilled schedule has no negative-caption branch to add metadata to.blur.control_path+preset_blur_strength: "very_high"runs and logs the new preset warning;show_input: truewith only acontrol_pathruns and logs the newshow_inputwarning;num_conditional_frames: 2withnum_video_frames_per_chunk: 1failed after model load before; it now runs and logs the two existing "is ignored by distilled causal Transfer" warnings;"resolution": 480(a number) failed the schema check before; it now runs at 480.🤖 Generated with Claude Code