Instructions to use onkarsus13/Unifiedweights with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use onkarsus13/Unifiedweights with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("onkarsus13/Unifiedweights", 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
UnifiedFlow weights
A self-contained UnifiedFlow pipeline for text-to-image and image-to-text
inference, with a separate text-pretraining variant in pretrain/.
The shared DiT models image and text embeddings. TextEncoder supplies text embeddings, ColaDecoder produces tokens, and the frozen image codec converts between image embeddings and pixels. The image output resolution is 224 × 224.
Download and install
The repository includes the Python implementation required to load these custom
components. Authenticate with hf auth login if the repository is private.
hf download onkarsus13/Unifiedweights --local-dir ./Unifiedweights \
--exclude "pretrain/*"
python -m pip install ./Unifiedweights
Generate an image and caption
from unifiedflow import UnifiedFlowPipeline
pipe = UnifiedFlowPipeline.from_pretrained(
"onkarsus13/Unifiedweights",
load_image_encoder=True,
load_image_decoder=True,
).to("cuda")
image = pipe.generate_image("A red apple on a wooden table.").images[0]
image.save("apple.png")
result = pipe.generate_text(
image=image,
prompt="Describe this image.",
max_new_tokens=256,
)
print(result.texts[0])
print(result.finish_reason)
For an existing download, replace the repository ID with "./Unifiedweights".
For captioning alone, load only the image encoder. For image generation alone,
load only the image decoder. Text stops at EOS or the configured token limit;
finish_reason reports "eos" or "length".
Text continuation
pipe = UnifiedFlowPipeline.from_pretrained(
"onkarsus13/Unifiedweights",
subfolder="pretrain",
).to("cuda")
result = pipe.generate_text(
prompt="The future of artificial intelligence is",
max_new_tokens=128,
)
print(result.texts[0])
Files
model_index.json
transformer/ config.json + diffusion_pytorch_model.safetensors
text_encoder/ config.json + diffusion_pytorch_model.safetensors
text_decoder/ config.json + diffusion_pytorch_model.safetensors
image_codec/ config.json + diffusion_pytorch_model.safetensors
tokenizer/
pretrain/ self-contained text-pretraining variant
src/unifiedflow/ Python implementation
pyproject.toml
Each variant contains the complete model components. Loading from the Hub fetches only the selected variant and requested image codec. All model tensors use Safetensors; optimizer states and external filesystem references are excluded.
These are packaged pretrained inference checkpoints. No additional training or new quality evaluation is claimed.
Component licenses are listed in LICENSES/README.md.
Required copyrights, asset provenance, and source revisions are retained in
LICENSE, THIRD_PARTY_NOTICES.md, and LICENSES/.
- Downloads last month
- 2