Instructions to use nvidia/Cosmos3-Super-Text2Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Super-Text2Image with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Diffusers
How to use nvidia/Cosmos3-Super-Text2Image with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nvidia/Cosmos3-Super-Text2Image", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
File size: 1,236 Bytes
fdafd05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """Public defaults for the standalone agentic text-to-image upsampler."""
from __future__ import annotations
from typing import Any
DEFAULT_OPENAI_ENDPOINT_URL = "https://api.openai.com/v1"
DEFAULT_UPSAMPLER_ENDPOINT_URL = DEFAULT_OPENAI_ENDPOINT_URL
DEFAULT_REWRITER_ENDPOINT_URL = DEFAULT_OPENAI_ENDPOINT_URL
DEFAULT_UPSAMPLER_MODEL = "gpt-5.5"
DEFAULT_REWRITER_MODEL = "gpt-5.5"
DEFAULT_OPENAI_API_KEY_ENV = "OPENAI_API_KEY"
DEFAULT_LLM_EXTRA_BODY: dict[str, Any] = {"reasoning_effort": "low"}
DEFAULT_CRITIC_ENDPOINT_URL = "https://generativelanguage.googleapis.com/v1beta/openai/"
DEFAULT_CRITIC_MODEL = "gemini-3.1-pro-preview"
DEFAULT_GEMINI_API_KEY_ENV = "GEMINI_API_KEY"
DEFAULT_GENERATION_AUTH_KEY_ENV = "AGENTIC_UPSAMPLING_GENERATION_AUTH_KEY"
DEFAULT_GENERATION_MODEL = "nvidia/Cosmos3-Super-Text2Image"
DEFAULT_IMAGE_SIZE = "1024x1024"
DEFAULT_GENERATION_EXTRA_ARGS: dict[str, Any] = {"guardrails": False, "use_resolution_template": False}
DEFAULT_RESOLUTION = "768"
DEFAULT_ASPECT_RATIO = "1,1"
DEFAULT_NUM_STEPS = 50
DEFAULT_GUIDANCE = 4.0
DEFAULT_FLOW_SHIFT = 3.0
DEFAULT_MAX_ITERATIONS = 2
DEFAULT_SAMPLES_PER_ITERATION = 3
DEFAULT_JPEG_QUALITY = 99
STRICT_OVERALL_THRESHOLD = 9.0
STRICT_PROMPT_THRESHOLD = 9.0
|