feat: Cosmos3 videogen worker on public cosmos-framework (overlay)#14
Merged
Conversation
Serving overlay for nvidia/Cosmos3-Nano and Cosmos3-Super on NVIDIA's public cosmos-framework, replacing the retired private EA fork (deepinfra/cosmos3): - worker.py: ported from the EA fork (import renames only); dynamo registration, schemas, gloo control-plane fix, torchrun relaunch and standalone mode unchanged. - Dockerfile: overlay build — clones cosmos-framework at a pinned ref, applies patches/, mirrors upstream's build, bakes worker + HF prefetch (incl. gated Cosmos-Guardrail1 for default-on guardrails). - patches/0001: encoder -threads cap (EA PR #19 re-applied). The 16 EA-era weight/code mismatch shims are obsolete upstream (native diffusers loading, AVAE released, parallelism-config bug fixed, guardrails default on). See examples/cosmos3/README.md for provenance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
||
|
|
||
| # Valid model_mode values for action modalities. | ||
| _ACTION_MODES = frozenset({"forward_dynamics", "inverse_dynamics", "policy"}) |
| w, h = int(parts[0]), int(parts[1]) | ||
| if (w, h) in _SIZE_TO_RES_AR: | ||
| res, ar = _SIZE_TO_RES_AR[(w, h)] | ||
| except ValueError: |
ARG values are recorded in image layer history, so a token passed that way is readable by anyone who can pull from the registry. The secret mount is available only during the RUN and never persists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- patches/0002: video guardrail runner drops the RetinaFace face-blur postprocessor, which unconditionally pixelates every detected face in every output frame (breaks the product; it is a privacy/anti-deepfake measure, not a content-safety control). The content-safety value stays: text-prompt guardrail (Blocklist + Qwen3Guard) is unchanged, and upstream already disables VideoContentSafetyFilter. Removal explicitly authorized by Johan (product owner) 2026-07-08. Flagged as potentially relevant to likeness/NCII/deepfake obligations; to be confirmed with legal as a follow-up (not a rollout blocker per Johan). - patches/0001 (encode-params): -threads cap plus explicit BT.709 signaling (colorspace+primaries+trc + limited range); conversion target and tag set together. Verified to round-trip identically to untagged on a compliant decoder — correctness hygiene, not a fix for a confirmed visible defect. - Dockerfile: apply patches + copy worker LAST (after the ~11GB gated prefetch), relying on the editable install, so patch iterations rebuild in seconds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
In-image A/B on a color test card, both decoded as BT.709 by a compliant decoder: fw-v1 untagged (current): red 253,0,0 green 0,255,0 skin 239,193,165 (~exact) bt709/tv tagged (patch): red 255,23,0 green 0,215,0 skin 243,196,163 (err up to 40) Setting -colorspace/-color_range as imageio output flags TAGS the stream but does not correctly drive the RGB->YUV conversion, so tag and pixels disagree (the mislabel trap). The untagged output already round-trips cleanly on a compliant decoder, so there is no confirmed visible defect to fix here anyway. 0001 reverts to the thread-cap-only change. Proper color signaling (force the conversion via a scale filter matched to the tag) is deferred to its own task, gated on first confirming an actual browser-rendering problem exists. fw-v2 = face-blur removal (0002) + encoder thread cap (0001). No color change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…red imports) Formatting-only: black + isort reflow, and # noqa: E402 on the imports that must follow init_script() (the required init-before-heavy-imports pattern, same as cosmos_framework's own scripts). No behavior change — the built fw-v2 image (from the pre-format worker.py) is byte-behavior-identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Johan-de-R
added a commit
that referenced
this pull request
Jul 9, 2026
fix: cosmos3 worker.py /opt/app path + CodeQL except:pass (follow-up to #14)
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.
Summary
deepinfra/cosmos3) onto NVIDIA's public cosmos-framework, pinned at463ac142.examples/diffusersfor LTX/FastWan):worker.py+Dockerfile(clones upstream at the pin, appliespatches/) +patches/0001(encoder-threadscap, EA PR fix: cosmos3 worker.py /opt/app path + CodeQL except:pass (follow-up to #14) #19 re-applied). No DeepInfra copy of the framework repo exists — this directory is the whole reviewable delta.worker.pyis the EA worker with only the six import lines renamed (cosmos3.*→cosmos_framework.*); dynamo registration, request/response schemas, gloo idle-watchdog fix, torchrun relaunch, standalone mode unchanged. All symbols verified present/compatible in the public framework.Validation
py_compileon worker.py and the patched handler.🤖 Generated with Claude Code