Any-to-Any
Diffusers
Safetensors
English
UnifiedFlowPipeline
unifiedflow
text-to-image
image-to-text
text-generation
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
|
Download README.md from onkarsus13/Unifiedweights: direct link, hf CLI and curl.
- Browser
- Download file 3.09 kB
-
https://huggingface.co/onkarsus13/Unifiedweights/resolve/main/README.md
- Command line
-
hf download hf://onkarsus13/Unifiedweights/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/onkarsus13/Unifiedweights/resolve/main/README.md
3.09 kB
| library_name: diffusers | |
| pipeline_tag: any-to-any | |
| license: other | |
| license_name: component-specific-licenses | |
| license_link: https://huggingface.co/onkarsus13/Unifiedweights/blob/main/LICENSES/README.md | |
| language: | |
| - en | |
| tags: | |
| - unifiedflow | |
| - text-to-image | |
| - image-to-text | |
| - text-generation | |
| - safetensors | |
| # 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. | |
| ```bash | |
| hf download onkarsus13/Unifiedweights --local-dir ./Unifiedweights \ | |
| --exclude "pretrain/*" | |
| python -m pip install ./Unifiedweights | |
| ``` | |
| ## Generate an image and caption | |
| ```python | |
| 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 | |
| ```python | |
| 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 | |
| ```text | |
| 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](LICENSES/README.md). | |
| Required copyrights, asset provenance, and source revisions are retained in | |
| `LICENSE`, `THIRD_PARTY_NOTICES.md`, and `LICENSES/`. | |