julienkay/tools.doji.diffusers
حول
A Unity package to run pretrained diffusion models with Unity Sentis
التصميم والوسائطالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- ٠
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلDiffusers
A Unity port of Hugging Face diffusers. Generate images with Stable Diffusion, SDXL and FLUX, and estimate depth with Marigold, on-device with Unity Inference Engine.
OpenUPM · Documentation · Changelog · Discussion · More packages
![Five images generated with FLUX.3 [klein] in Unity](https://raw.githubusercontent.com/julienkay/tools.doji.diffusers/master/docs/images/flux3-klein-gallery.webp)
FLUX.3 [klein], 1024 × 1024, 16 steps. Generated in Unity on an RTX 3060.
Installation
Install from OpenUPM
- In Edit > Project Settings > Package Manager, add a scoped registry:
- Name:
OpenUPM - URL:
https://package.openupm.com - Scope:
tools.doji
- Name:
- In Window > Package Manager, open My Registries and install Diffusers.
Or, with the OpenUPM CLI: openupm add tools.doji.diffusers
Usage
using Doji.AI.Diffusers;
using var pipe = await Flux3KleinPipeline.FromSingleFileAsync("AtomicChat/FLUX-3-Image-Klein-GGUF",
"FLUX-3-Image-Klein-Q8_0.gguf", "text_encoders/Qwen3-VL-4B-Instruct-Q8_0.gguf", "vae/ae.safetensors");
pipe.EnableModelCpuOffload();
using var output = await pipe.GenerateAsync(new Text2ImageParameters {
Prompt = "Stylized low-poly village at dusk, warm lit windows, a stone bridge over a river",
});
output.SaveAsPng("village.png");
Models come from the Hugging Face Hub. In the Editor, AI Model Hub downloads them on first use. Loading models covers pipeline repositories, single-file checkpoints and GGUF files.
More than text to image

SDXL with ControlNet keeps the edges of an image and changes everything else.

Marigold estimates depth, and its uncertainty from an ensemble of five predictions.
Performance
For example, square FLUX.3 [klein] images on an RTX 3060 12 GB, with Q8_0 weights, 16 steps and flash attention. CPU offload (EnableModelCpuOffload) keeps only the active model on the GPU, which halves the memory it needs.
| Size | CPU offload | Time per image | GPU memory |
|---|---|---|---|
| 512 px | 36–48 s | 11.0 GB | |
| 512 px | ✓ | 47 s | 5.5 GB |
| 768 px | ✓ | 95 s | 5.8 GB |
| 1024 px | ✓ | 172 s | 7.3–8.3 GB |
Unity 6000.3.8f1, Direct3D 11, Inference Engine 2.6.1, November 2026. GPU memory is the peak above idle.
Development
Open projects/Diffusers in Unity. It references the package in tools.doji.diffusers/, and its EditMode tests compare each pipeline with diffusers on tiny models. The Python scripts in tools/ export models and generate the reference data.
Acknowledgements
- Hugging Face diffusers, whose pipelines, schedulers and API this package follows. See Third Party Notices.
- The model authors: Stability AI for Stable Diffusion, Black Forest Labs for FLUX, Lvmin Zhang for ControlNet, and PRS-ETH for Marigold.
- llama.cpp for the GGUF format, and Unsloth and AtomicChat for their quantized FLUX models.
Made by Doji Technologies
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…