Skip to content

Add transfer inference control-CFG and per-hint defaults - #16

Merged
lfengad merged 2 commits into
NVIDIA:mainfrom
trungtpham:feature/transfer-control-guidance
Jun 7, 2026
Merged

Add transfer inference control-CFG and per-hint defaults#16
lfengad merged 2 commits into
NVIDIA:mainfrom
trungtpham:feature/transfer-control-guidance

Conversation

@trungtpham

@trungtpham trungtpham commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add control-CFG (control_guidance, optional interval) to sampling args and OmniMoTModel.generate_samples_from_batch, including a no-control branch for multi-vision transfer samples.
  • Wire transfer inference in OmniInference: dedicated batch path (batch size 1), skip generic get_sample_data when transfer hints are set, pass control-CFG through generate_transfer_sample.
  • Extend sample args with transfer hint fields on SampleData (edge / blur / depth / seg / wsm), _TRANSFER_DEFAULTS (guidance, control_guidance, shift; WSM 101f @ 10 fps), and control-only specs via control_path without vision_path.
  • Load JSON prompts and negative_prompt_file only for transfer specs.

Test plan

  • Run transfer cookbook / torchrun -m cosmos_framework.scripts.inference with specs/edge.json on Cosmos3-Nano (--no-guardrails).
  • Verify control_guidance != 1.0 runs without fallback warning when control + target vision items are present.
  • Smoke each hint type (edge, blur, depth, seg, wsm) with precomputed control_path only.

@trungtpham
trungtpham force-pushed the feature/transfer-control-guidance branch from 0c7b571 to 24d78b9 Compare June 3, 2026 21:36
Comment thread cosmos_framework/inference/inference.py Outdated
Comment thread cosmos_framework/inference/inference.py
Comment thread cosmos_framework/inference/args.py
@lfengad

lfengad commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@trungtpham Seems that we need first rebase on some newest features from the current main like @foreverlms noted. Currently seems that some new features are occasionally reverted. THX!

@trungtpham
trungtpham force-pushed the feature/transfer-control-guidance branch 2 times, most recently from f9c5399 to eac2090 Compare June 4, 2026 17:04
@trungtpham

Copy link
Copy Markdown
Contributor Author

@foreverlms @lfengad thanks for your review. I rebased the PR to the latest main. Could you please have another look? Thanks

@lfengad

lfengad commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

@trungtpham Thx for the action, and seems the two smoke tests broken needs to be fixed?

@lfengad

lfengad commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Will this solve the issue in #14?

Comment thread cosmos_framework/model/vfm/omni_mot_model.py
@trungtpham
trungtpham force-pushed the feature/transfer-control-guidance branch from 09a3b50 to 1a0a7f0 Compare June 5, 2026 04:27
Preserve existing inference behavior while fixing control_guidance defaults and guarding mixed-rank control-CFG alignment when a local rank has no control branch state.
@trungtpham
trungtpham force-pushed the feature/transfer-control-guidance branch from 1a0a7f0 to 9ce4424 Compare June 5, 2026 05:06
@trungtpham

Copy link
Copy Markdown
Contributor Author

@trungtpham Thx for the action, and seems the two smoke tests broken needs to be fixed?

I have applied fixes. awaiting for test report.

@trungtpham

Copy link
Copy Markdown
Contributor Author

Will this solve the issue in #14?

Yes. that's correct.

@foreverlms foreverlms left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@foreverlms
foreverlms requested a review from yy-code-nv June 5, 2026 07:51
@trungtpham

Copy link
Copy Markdown
Contributor Author

@yy-code-nv could you please help review the PR? Thanks

@lfengad
lfengad enabled auto-merge (squash) June 7, 2026 16:36
@lfengad
lfengad merged commit 3a5314b into NVIDIA:main Jun 7, 2026
6 checks passed
rahul-steiger-nv pushed a commit to rahul-steiger-nv/cosmos-framework that referenced this pull request Jun 15, 2026
## Summary

- Add **control-CFG** (`control_guidance`, optional interval) to
sampling args and `OmniMoTModel.generate_samples_from_batch`, including
a no-control branch for multi-vision transfer samples.
- Wire **transfer inference** in `OmniInference`: dedicated batch path
(batch size 1), skip generic `get_sample_data` when transfer hints are
set, pass control-CFG through `generate_transfer_sample`.
- Extend sample args with **transfer hint fields** on `SampleData`
(`edge` / `blur` / `depth` / `seg` / `wsm`), `_TRANSFER_DEFAULTS`
(guidance, control_guidance, shift; WSM 101f @ 10 fps), and control-only
specs via `control_path` without `vision_path`.
- Load **JSON prompts** and **`negative_prompt_file`** only for transfer
specs.

## Test plan

- [x] Run transfer cookbook / `torchrun -m
cosmos_framework.scripts.inference` with `specs/edge.json` on
Cosmos3-Nano (`--no-guardrails`).
- [x] Verify `control_guidance != 1.0` runs without fallback warning
when control + target vision items are present.
- [x] Smoke each hint type (edge, blur, depth, seg, wsm) with
precomputed `control_path` only.

Co-authored-by: lfengad <liangf@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants