How to Disable Safety Guardrails in Cosmos 3 Generation
You can disable Cosmos 3 safety guardrails by setting "guardrails": false inside the extra_params JSON for a single request, passing --no-guardrails in the CLI, or launching the server with a no_guardrails.yaml deploy config that prevents guardrail models from loading entirely.
The NVIDIA Cosmos repository ships with built-in safety filters that screen prompts for disallowed content and blur faces in generated video. These guardrails are enabled by default (guardrails: true), but the codebase provides several mechanisms to turn them off depending on whether you need a one-off exception or a permanent deployment change. This guide covers the exact flags, JSON payloads, and configuration files used in the Cosmos 3 source code to disable them.
What Are Cosmos 3 Safety Guardrails?
As implemented in NVIDIA/cosmos, the safety guardrails perform two distinct functions. First, they screen every incoming prompt for disallowed content before generation begins. Second, they apply automatic face-blurring filters to the final visual output. Because these checks run by default, any production or research workflow that requires unfiltered outputs must explicitly override the guardrails parameter.
Three Methods to Disable Guardrails in Cosmos 3
You can turn off safety guardrails at three different scopes. Choose the option that matches your integration pattern.
Per-Request Override via extra_params
For a single generation call, add "guardrails": false to the extra_params object in your request payload. This tells the Cosmos 3 inference server to skip prompt screening and face blurring for that call only. All other concurrent or subsequent requests continue to use the default protected path.
CLI Override with --no-guardrails
When using the Cosmos CLI client, pass the --no-guardrails flag or the equivalent --extra_params='{"guardrails":false}'. This applies strictly to the current cosmos-cli generate invocation and mirrors the per-request JSON override at the command-line level.
Server-Wide Disable via Deploy Config
To disable guardrails for every request handled by a node, create a deployment configuration file that sets guardrails: false. You can also set offload_guardrail_models: false to free GPU memory by preventing the guardrail models from loading in the first place. Launch the server with:
cosmos-server --deploy-config no_guardrails.yaml
When guardrails are disabled server-wide, the per-request extra_params override cannot re-enable them because the underlying models are never loaded.
Code Examples for Disabling Cosmos 3 Guardrails
The following examples are derived directly from the NVIDIA Cosmos repository and show the exact syntax required for each scope.
cURL REST API — Disable Per Request
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}'
The extra_params field carries "guardrails":false, which instructs the endpoint to bypass safety checks for this specific request.
Python SDK — Disable Per Request
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())
This pattern matches the Python client logic shown in cookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb, where extra_params={"guardrails": False} is used for a robotics forward-dynamics run.
CLI — Disable with a Flag
cosmos-cli generate \
--model cosmos3-nano \
--prompt "A robot pours water into a cup." \
--extra_params '{"guardrails":false}'
# Equivalent shorthand
cosmos-cli generate --no-guardrails \
--model cosmos3-nano \
--prompt "A robot pours water into a cup."
The --no-guardrails option is demonstrated in cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb (lines 864–1199), where it is forwarded to the underlying generation command.
Server-Wide — Deploy Config File
Create a file named no_guardrails.yaml with the following content:
# no_guardrails.yaml
guardrails: false
offload_guardrail_models: false # optional – frees GPU memory
Then start the server:
cosmos-server --deploy-config no_guardrails.yaml
With this configuration, all subsequent generation calls run without guardrails regardless of client-side extra_params.
Where Disabling Guardrails Is Documented in the Source Code
The controls above are documented across several key files in the NVIDIA/cosmos repository:
README.md— The "Disabling guardrails" section (lines 393–421) describes both theextra_paramsJSON flag and the server-wide deploy config approach.cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb— Shows the--no-guardrailsCLI flag being passed to the generation framework (lines 864–1199).cookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb— Contains Python client code that setsextra_params={"guardrails": False}for VLLM-based generation.no_guardrails.yaml— The example deploy-config file used to disable guardrails globally and optionally offload guardrail models.
Summary
- Cosmos 3 ships with
guardrails: trueby default, screening prompts and blurring faces. - To disable safety guardrails in Cosmos 3 generation for a single call, set
"guardrails": falseinsideextra_params. - Use the
--no-guardrailsCLI flag for one-off command-line tasks. - For a permanent, server-wide disablement, deploy
no_guardrails.yamlviacosmos-server --deploy-config no_guardrails.yaml; this prevents guardrail models from loading and cannot be overridden per request.
Frequently Asked Questions
Can I re-enable guardrails for a single request if they are disabled server-wide?
No. When you deploy a server-wide configuration that sets guardrails: false, the guardrail models are never loaded into memory. Because the infrastructure is not present, a per-request extra_params override cannot re-enable them. You must restart the server without the deploy config to restore guardrail functionality.
Does disabling guardrails improve GPU memory usage?
It can. If you add offload_guardrail_models: false to the deploy config, the Cosmos 3 server will not load the dedicated guardrail models into GPU memory. This reduces memory overhead, which is beneficial for large-scale or resource-constrained deployments.
Is the --no-guardrails flag available in all Cosmos CLI versions?
The --no-guardrails shorthand is implemented in the Cosmos CLI as shown in cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb. If your CLI does not recognize the flag, you can use the long-form equivalent --extra_params='{"guardrails":false}', which is accepted by any version that parses the standard generation parameters.
What content filters are bypassed when guardrails are disabled?
Disabling guardrails removes two specific protections: prompt screening for disallowed content and automatic face-blurring in the generated video output. As implemented in the NVIDIA Cosmos source code, these are the only safety mechanisms controlled by the guardrails boolean flag.
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 →