Run this model with HF Jobs
Run mingyi456/Cosmos-Predict2-14B-Text2Image-DF11 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mingyi456/Cosmos-Predict2-14B-Text2Image-DF11. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mingyi456/Cosmos-Predict2-14B-Text2Image-DF11 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use mingyi456/Cosmos-Predict2-14B-Text2Image-DF11 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use mingyi456/Cosmos-Predict2-14B-Text2Image-DF11 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("mingyi456/Cosmos-Predict2-14B-Text2Image-DF11", 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
- Local Apps Settings
- Draw Things
- DiffusionBee
Update README.md
Browse files52 unmodified lines535455565657585958596061626364656667686970717273747576777852 unmodified lines2. To use the DFloat11 model, run the following example code in Python: ```python import torch from diffusers import Cosmos2TextToImagePipeline from diffusers import Cosmos2TextToImagePipeline, CosmosTransformer3DModel from dfloat11 import DFloat11Model pipe = Cosmos2TextToImagePipeline.from_pretrained("nvidia/Cosmos-Predict2-14B-Text2Image", torch_dtype=torch.bfloat16) pipe.enable_model_cpu_offload() from transformers.modeling_utils import no_init_weights
with no_init_weights(): transformer = CosmosTransformer3DModel.from_config( CosmosTransformer3DModel.load_config( "nvidia/Cosmos-Predict2-14B-Text2Image", subfolder="transformer" ), torch_dtype=torch.bfloat16 ).to(torch.bfloat16) pipe = Cosmos2TextToImagePipeline.from_pretrained( "nvidia/Cosmos-Predict2-14B-Text2Image", transformer=transformer, torch_dtype=torch.bfloat16 ) DFloat11Model.from_pretrained("mingyi456/Cosmos-Predict2-14B-Text2Image-DF11", device='cpu', bfloat16_model=pipe.transformer) pipe.enable_model_cpu_offload() prompt = "A close-up shot captures a vibrant yellow scrubber vigorously working on a grimy plate, its bristles moving in circular motions to lift stubborn grease and food residue. The dish, once covered in remnants of a hearty meal, gradually reveals its original glossy surface. Suds form and bubble around the scrubber, creating a satisfying visual of cleanliness in progress. The sound of scrubbing fills the air, accompanied by the gentle clinking of the dish against the sink. As the scrubber continues its task, the dish transforms, gleaming under the bright kitchen lights, symbolizing the triumph of cleanliness over mess." negative_prompt = "The video captures a series of frames showing ugly scenes, static with no motion, motion blur, over-saturation, shaky footage, low resolution, grainy texture, pixelated images, poorly lit areas, underexposed and overexposed scenes, poor color balance, washed out colors, choppy sequences, jerky movements, low frame rate, artifacting, color banding, unnatural transitions, outdated special effects, fake elements, unconvincing visuals, poorly edited content, jump cuts, visual noise, and flickering. Overall, the video is of poor quality." image = pipe(README.md+18-3