Skip to content
Projetos

julienkay/tools.doji.diffusers

Ver no GitHub

Sobre

A Unity package to run pretrained diffusion models with Unity Sentis

Design e mídia

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
0

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

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

FLUX.3 [klein], 1024 × 1024, 16 steps. Generated in Unity on an RTX 3060.

Installation

Install from OpenUPM
  1. In Edit > Project Settings > Package Manager, add a scoped registry:
    • Name: OpenUPM
    • URL: https://package.openupm.com
    • Scope: tools.doji
  2. 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

A canny edge map of the village, restyled by SDXL with ControlNet as a watercolor and as a winter scene

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

The village and its Marigold depth map and uncertainty

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


Made by Doji Technologies

Explore projetos relacionados

Carregando…