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 files8 unmodified lines91011128 unmodified lineslanguage:- enpipeline_tag: text-to-image---8 unmodified lines91011121314151617181920212223242526272829303132333435363738394041424344454647488 unmodified lineslanguage:- enpipeline_tag: text-to-image---For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11This is my first time using DF11 to compress a model outside the Flux architecture. The reason why it is much easier for me to compress Flux-based models is that### How to Use#### `diffusers`1. Install the DFloat11 pip package *(installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed)*:```bashpip install dfloat11[cuda12]# or if you have CUDA version 11:# pip install dfloat11[cuda11]```2. To use the DFloat11 model, run the following example code in Python:```pythonimport torchfrom diffusers import Cosmos2TextToImagePipelinefrom dfloat11 import DFloat11Modelpipe = Cosmos2TextToImagePipeline.from_pretrained("nvidia/Cosmos-Predict2-14B-Text2Image", torch_dtype=torch.bfloat16)pipe.enable_model_cpu_offload()DFloat11Model.from_pretrained("mingyi456/Cosmos-Predict2-14B-Text2Image-DF11", device='cpu', bfloat16_model=pipe.transformer)prompt = "A futuristic cityscape at sunset, with flying cars, neon lights, and reflective water canals"image = pipe(prompt,max_sequence_length=256,generator=torch.Generator("cpu").manual_seed(0)).images[0]image.save("Cosmos-Predict2-14B-Text2Image.png")```#### ComfyUI~~Follow the instructions (have not tested myself) here: https://github.com/LeanModels/ComfyUI-DFloat11~~
README.md+37-1