/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
FLUX.2-klein-4B
Опубликована
30 ноя 2026

FLUX.2-klein-4B-SM8450-NPU

Преобразование изображенийИзображение, текст → изображение
1 187скачиваний за 30 дней1лайквеса обновлены1 дек 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Сборка FLUX.2 klein 4B для редактирования изображений и генерации картинок по тексту на Snapdragon 8 Gen 1.

FLUX.2 klein 4B on Snapdragon NPU — сборка модели для редактирования изображений и генерации по тексту, подготовленная автором репозитория assassinshadow для Hexagon NPU в Snapdragon 8 Gen 1 (SM8450). Она объединяет FLUX.2 klein 4B и Qwen3-4B и включает графы QNN в формате w8a16, а также GGUF Q4_0 и safetensors. Модель принимает текстовую инструкцию и одно исходное изображение для редактирования либо только текст для генерации нового изображения. Выдаёт изображение размером 512 × 512; вычисления выполняются за 4 шага на NPU, а текстовый энкодер работает на GPU.

Сборка рассчитана на запуск в AutoDroid Studio на телефоне с Snapdragon 8 Gen 1. Она подходит для изменения ракурса, позы, одежды или окружения персонажа и для создания изображения по описанию. Лицензия — Apache-2.0.

Формат ограничивает применение фиксированными формами графов, разрешением 512 × 512 и четырьмя шагами. Поддерживается одно референсное изображение; графы собраны и проверены на SM8450, требуют 8 МБ VTCM и специальной среды запуска AutoDroid Studio. Совместимость с более новыми чипами не проверена.

Сценарии применения

  • изменение позы персонажа по текстовой инструкции
  • смена одежды на исходном изображении
  • редактирование окружения и фона изображения
  • изменение ракурса персонажа
  • генерация изображения 512 × 512 по текстовому описанию

Ограничения

Выход ограничен разрешением 512 × 512 и четырьмя шагами; доступны не более одного референсного изображения и фиксированные формы графов. Требуются Snapdragon 8 Gen 1 (SM8450) и среда AutoDroid Studio; работу на более новых чипах не проверяли.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

FLUX.2 klein 4B on the Snapdragon NPU (SM8450)

FLUX.2 klein 4B reference-picture editing, compiled for the Hexagon NPU of the Snapdragon 8 Gen 1 (SM8450, Hexagon v69). One picture in, one instruction, one edited picture out: a turned view, a new pose, a change of clothes, a new place. Since 2026-12-01 also text-to-image: a second set of the transformer graphs, compiled without the reference picture, draws a new picture from words alone.

Use it in AutoDroid Studio: the app downloads these files and runs them on the phone. In the avatar preset, choosing FLUX.2 klein 4B under Settings → Drawing → Image model draws the character's looks, outfits and poses with this model.

Speed and quality (Galaxy S22 Ultra, SM8450)

StageWhereTime
Qwen3-4B text encoder (+ loading)GPU (OpenCL, llama-style GGUF via a patched stable-diffusion.cpp)~17 s
Reference picture → latents (VAE encoder)NPU0.2 s
4 denoising steps (30 transformer graphs)NPU~61 s
Latents → picture (VAE decoder)NPU0.5 s
Whole edit, 512 × 512~81 s
Text-to-image: 4 denoising steps (npu_t2i/, no reference picture)NPU36-46 s
Whole text-to-image picture, 512 × 51275-86 s

For comparison, the same edit takes about 17 minutes with stable-diffusion.cpp on the phone's GPU and 31 minutes on its CPU.

Against the float model (PyTorch, diffusers) on the same inputs: the denoiser's noise predictions keep a cosine of 0.98 → 0.945 over the 4 steps and the final picture is visually the same (PSNR 23.5 dB, mean difference 7/255); the VAE decoder matches at PSNR 53.9 dB and the encoder's latents at cosine 0.9998. Text-to-image against the float model with the same prompt and noise: PSNR 18.5-21.8 dB, the same picture to the eye.

Files

PathWhat
klein.jsonManifest: every file with its size and SHA-256, the target chip and the fixed shapes
npu/dbla0-4.bin, npu/dblf0-4.binThe 5 double-stream blocks, each as an attention half and a feed-forward half
npu/sgl0-19.binThe 20 single-stream blocks
npu/vaeenc.bin, npu/vaedec.binVAE encoder and decoder, BatchNorm and the 2×2 patching folded in
npu_t2i/*.binThe same 30 transformer graphs for text-to-image: 512 text + 1024 picture tokens, no reference tokens
data/*.rawFloat32 tables the CPU side uses: picture and text embedders, final projection, the 4 steps' modulation and sigmas
te/Qwen3-4B-Q4_0.ggufThe text encoder (from unsloth/Qwen3-4B-GGUF)
te/flux2_vae_klein.safetensorsThe FLUX.2 VAE as a single file (loaded by the text-encoder step, not used for encoding)
te/flux-2-klein-4b-Q4_0.gguf.headOnly the header of leejet/FLUX.2-klein-4B-GGUF's Q4_0 file: the text-encoder step reads it to recognise the model family; the weights it would point at are never read, so the app extends it to its original length as a sparse file

About 9.8 GB in all (3.6 GB of it the text-to-image graphs).

How it was made

  • Every block was rewritten for the HTP (hidden states as [1, C, 1, tokens], linear layers as 1×1 convolutions, rotary pairs permuted into the q/k weights), checked against the diffusers block, exported to ONNX and compiled with QAIRT 2.32 as w8a16 context binaries for v69 with 8 MB of VTCM, calibrated on the real inputs of two float edits (the text-to-image set on three float text-to-image runs; its step schedule and modulation tables are the edit's, so data/ serves both).
  • The residual stream stays on the CPU in float32: a few text tokens carry hidden values above 50,000 that no 16-bit tensor encoding can hold beside the rest. The CPU does each block's LayerNorm and modulation and adds the block's update; the NPU graphs return the gated updates.
  • On v69 the second operand of softmax(qkᵀ)·v is converted to 8 bits. A few prompt-dependent text tokens have |v| near 90 against ~0.5 elsewhere, which zeroed most of v; each graph splits v into a clipped part and the rest, each with its own 8-bit scale.
  • One process can hold only about four of these graphs on this chip, and freeing a context restarts the DSP, so each step runs as a chain of short-lived worker processes, the next one loading while the current one computes.

Limits

  • 512 × 512 output, one reference picture (or none, with npu_t2i/), 4 steps. Positions, modulation tables and graph shapes are fixed at compile time.
  • Built and tested on the Snapdragon 8 Gen 1 (SM8450). The graphs need 8 MB of VTCM, so the Snapdragon 888 and older cannot load them. Newer chips should load v69 binaries but are untested.
  • These are QNN context binaries plus raw tables, not a general-purpose checkpoint: they need the runner in AutoDroid Studio (the CPU side, the worker chain and the text-encoder step).
  • Picture quality follows FLUX.2 klein 4B at 4 steps; poses are described in words (no pose skeletons).

Licences

  • FLUX.2 klein 4B and its VAE: Apache-2.0, © Black Forest Labs.
  • Qwen3-4B: Apache-2.0, © Alibaba Cloud (GGUF conversion by Unsloth).
  • These compiled files are released under Apache-2.0 (see LICENSE).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Модели «картинка → картинка» пока не запускаются: нужен ввод изображения для diffusion.

Ревизия весов
564bad4

0 моделей