Text-to-Image
Diffusers
Safetensors
Cosmos
Cosmos3OmniDiffusersPipeline
cosmos3_omni
cosmos3
quantization
int4
awq
4-bit precision
modelopt
image-to-video
Instructions to use Reza2kn/Cosmos3-Nano-INT4-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Reza2kn/Cosmos3-Nano-INT4-AWQ with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Reza2kn/Cosmos3-Nano-INT4-AWQ", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Cosmos
How to use Reza2kn/Cosmos3-Nano-INT4-AWQ 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
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Can't seems to generate video correctly
#2
by William-R - opened
Modified from this space, which can generate video just fine. But can't seems to work with this repo weight
seed: 807131831
prompt: A cinematic wide shot of a vintage red convertible driving along a coastal highway at sunset. Waves crash against rocks below as the car speeds toward the horizon. Golden hour lighting, lens flare, smooth tracking shot.
Original repo weight
This repo weight
Modification from
pipe = Cosmos3OmniPipeline.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
enable_safety_checker=True,
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=10.0)
pipe.to("cuda")
to
from diffusers import Cosmos3OmniPipeline, Cosmos3OmniTransformer
from huggingface_hub import snapshot_download
import modelopt.torch.opt as mto
repo = snapshot_download("Reza2kn/Cosmos3-Nano-INT4-AWQ")
tf = Cosmos3OmniTransformer.from_config(
Cosmos3OmniTransformer.load_config(f"{repo}/transformer/config.json")
).to(torch.bfloat16)
mto.restore(tf, f"{repo}/transformer/modelopt_quantized.pt")
pipe = Cosmos3OmniPipeline.from_pretrained(
repo, transformer=tf,
torch_dtype=torch.bfloat16, enable_safety_checker=False,
).to("cuda")
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=10.0)
pipe.to("cuda")
and
with torch.autocast("cuda", dtype=torch.bfloat16):
result = pipe(...)
It should be note that on Cosmos3OmniTransformer.from_config it give the following warning
The config attributes {'action_dim': 64, 'action_gen': True, 'dtype': 'bfloat16', 'freeze_und': False, 'hidden_act': 'silu', 'initializer_range': 0.02, 'joint_attn_implementation': 'two_way', 'max_action_dim': 64, 'max_position_embeddings': 262144, 'model_type': 'qwen3_vl_text', 'num_embodiment_domains': 32, 'position_embedding_type': 'unified_3d_mrope', 'qk_norm': False, 'qk_norm_for_diffusion': True, 'qk_norm_for_text': True, 'temporal_compression_factor_sound': 1, 'use_cache': True, 'use_moe': True, 'video_temporal_causal': False} were passed to Cosmos3OmniTransformer, but are not expected and will be ignored. Please verify your config.json configuration file.
I am not sure about its significant currently
The image generation seems to be okay (single frame), but for multiple frames, (and sound) the decoded latent becomes blocky-blobs
William-R changed discussion title from Can't seems to generate video to Can't seems to generate video correctly