Cosmos 3 Guardrails Configuration: How to Disable Safety Features in NVIDIA Cosmos
You can disable NVIDIA Cosmos 3 safety guardrails through three distinct methods: per-request via the extra_params JSON payload, command-line using the --no-guardrails flag, or server-wide by deploying a YAML configuration file with guardrails: false.
NVIDIA Cosmos 3 includes built-in safety mechanisms that screen prompts for disallowed content and automatically blur faces in generated visual output. These protective features are enabled by default in the NVIDIA/cosmos repository to ensure responsible AI generation. Understanding how to configure or disable these guardrails is essential for developers who need full control over the generation pipeline in controlled environments.
Understanding Cosmos 3 Safety Guardrails
Default Guardrail Behavior
According to the source code in README.md, Cosmos 3 ships with safety mechanisms that perform two primary functions: screening input prompts for prohibited content and applying face-blurring to generated videos. The guardrails parameter defaults to true in all generation configurations, meaning every request undergoes these safety checks unless explicitly overridden.
Components of the Safety System
The guardrail system consists of separate models for prompt analysis and output filtering. When disabled via the server-wide configuration, you can optionally set offload_guardrail_models: false to prevent these models from loading into GPU memory entirely, freeing up computational resources for the generation task.
Three Methods to Disable Cosmos 3 Guardrails
Per-Request Configuration via API
For individual API calls, add "guardrails": false to the extra_params JSON object in your request payload. This method allows granular control where specific requests bypass safety checks while others maintain protection. The implementation examples in cookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb demonstrate this pattern for robotics forward-dynamics generation tasks.
Command-Line Interface Override
When using the Cosmos CLI, pass the --no-guardrails flag or the equivalent --extra_params='{"guardrails":false}' argument. As shown in cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb, this flag propagates through the generation command to disable screening for that specific CLI invocation only.
Server-Wide Deployment Configuration
To disable guardrails globally, create a deployment YAML file (e.g., no_guardrails.yaml) setting guardrails: false and optionally offload_guardrail_models: false. Launch the server with cosmos-server --deploy-config no_guardrails.yaml to prevent guardrail models from loading entirely. In this configuration, per-request overrides cannot re-enable the safety features since the models are not resident in memory.
Code Implementation Examples
REST API Example (cURL)
Disable guardrails for a single request using the extra_params field in your POST payload:
curl -X POST https://<your-endpoint>/v1/chat/completions \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
--form-string 'messages=[
{"role":"system","content":"You are a helpful assistant."},
{"role":"user","content":"Generate a video of a robot pouring water."}
]' \
--form-string 'extra_params={"guardrails":false,"use_resolution_template":false,"use_duration_template":false}'
Python SDK Implementation
Pass the guardrails parameter within the extra_params dictionary when using the Python requests library:
import requests, json, os
endpoint = "https://<your-endpoint>/v1/chat/completions"
headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}
payload = {
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Generate a video of a robot pouring water."}
],
"extra_params": {
"guardrails": False, # <-- disable guardrails
"use_resolution_template": False,
"use_duration_template": False
}
}
resp = requests.post(endpoint, headers=headers, json=payload)
print(resp.json())
CLI Command Structure
Use the --no-guardrails shorthand or the explicit JSON parameter form:
cosmos-cli generate \
--model cosmos3-nano \
--prompt "A robot pours water into a cup." \
--extra_params '{"guardrails":false}'
# Or equivalently
cosmos-cli generate --no-guardrails --model cosmos3-nano --prompt "A robot pours water into a cup."
Server Configuration File
Create no_guardrails.yaml to disable guardrails for all subsequent requests:
# no_guardrails.yaml
guardrails: false
offload_guardrail_models: false # optional – frees GPU memory by not loading guardrail models
Start the server with the deployment configuration:
cosmos-server --deploy-config no_guardrails.yaml
Summary
- Per-request disable: Add
"guardrails": falseto theextra_paramsJSON payload for granular control over individual API calls. - CLI disable: Use the
--no-guardrailsflag or--extra_params='{"guardrails":false}'when runningcosmos-cli generatecommands. - Server-wide disable: Deploy a YAML configuration with
guardrails: falseand launch with--deploy-configto prevent guardrail models from loading entirely. - Performance benefit: Setting
offload_guardrail_models: falsein server configurations frees GPU memory by preventing the safety models from loading.
Frequently Asked Questions
What happens when I disable Cosmos 3 guardrails?
When disabled, Cosmos 3 skips the prompt screening phase and does not apply face-blurring to the generated visual output. The generation pipeline proceeds directly to the video synthesis stage without content moderation checks.
Can I re-enable guardrails after deploying a server-wide disable configuration?
No. When you deploy a server-wide configuration with guardrails: false and offload_guardrail_models: false, the guardrail models are never loaded into memory. Since the models are not resident, per-request parameters cannot re-enable them; you must restart the server with a different configuration file.
Does disabling guardrails improve generation performance?
Yes. Disabling guardrails reduces computational overhead by eliminating the prompt analysis and output filtering inference steps. Additionally, setting offload_guardrail_models: false in your deployment configuration prevents the guardrail models from occupying GPU memory, making those resources available for the video generation model.
Where are the guardrail configurations documented in the repository?
The primary documentation resides in README.md (lines 393-421), which explains both the extra_params JSON flag and the server-wide deployment configuration. Practical implementations appear in the cookbook notebooks, specifically cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb for CLI usage and cookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb for Python SDK examples.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →