You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

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
Safetensors
Model size
2B params
Tensor type
F32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support