RealVisXL V4.0 Lightning (QNN NPU)
RealVisXL V4.0 Lightning, a photoreal SDXL fine-tune, compiled for the Qualcomm Hexagon NPU so TokForge can make 1024x1024 pictures on Snapdragon phones.
Published by TokForge for on-device inference.
| What it is | NPU image pipeline |
| Format | QNN HTP context binaries: W8A16 UNet and fp16 text encoders, one set per Hexagon generation, plus MNN files for the CPU parts |
| Runs on | Snapdragon phones (Hexagon NPU), with the embedding MLP and the TAESDXL decoder on the CPU |
| Phone class | 12 GB RAM or more (TokForge catalog); Snapdragon 8 Gen 3 or 8 Elite Gen 5 |
| Download | 30.6 GB (69 files) |
| Base model | SG161222/RealVisXL_V4.0_Lightning |
| License | CreativeML OpenRAIL++-M plus SG_161222's Civitai terms (credit required, no selling); the qnn_runtime/ files are under Qualcomm's AI Stack License |
TokForge
- Website: https://tokforge.ai
- Discord: https://discord.gg/Acv3CBtfVm
- Google Play: https://play.google.com/store/apps/details?id=dev.tokforge
- iOS TestFlight: https://testflight.apple.com/join/jnufjzRr
Runs on-device in the TokForge app.
Use it in TokForge
- Install TokForge from Google Play.
- On Android, open Models > Recommended > Image and download SDXL Faithful: RealVisXL (NPU). TokForge lists it on phones with 12 GB RAM or more and a supported Snapdragon NPU.
- TokForge reads your phone's Hexagon generation and downloads only the matching set (about 4.3 GB). Where that set lists the reference-photo files in
ip/, they come along too (about 6.8 GB more). - Ask for a picture in a chat. To keep a person's face, attach a reference photo; without one, renders are unchanged. The model runs on the phone; once it is downloaded, making pictures needs no connection.
Collections: TokForge Image Models (Android), TokForge NPU Packs.
Files
| File | Size | What it is |
|---|---|---|
ip/ |
13.4 GB in 8 files | Reference-photo add-on: IP-Adapter UNet binaries for V75 and V81, CLIP ViT-H encoder and plus-face Resampler (MNN), projection weights, plus their DLC and .npz source forms |
manifest.json |
24.4 KB | Per-arch file lists with sizes and md5, IO contracts and the reference-photo (ip) block |
qnn_runtime/ |
46.0 MB in 4 files | Qualcomm QAIRT 2.40 Hexagon runtime libraries for V75 and V81 (Qualcomm AI Stack License, see Credits) |
v73/ |
4.31 GB in 14 files | Hexagon V73 set: W8A16 UNet, fp16 CLIP-L and OpenCLIP-bigG encoders, embedding MLP, TAESDXL decoder (MNN), tokenizers, config |
v75/ |
4.31 GB in 14 files | Hexagon V75 set: W8A16 UNet, fp16 CLIP-L and OpenCLIP-bigG encoders, embedding MLP, TAESDXL decoder (MNN), tokenizers, config |
v79/ |
4.31 GB in 14 files | Hexagon V79 set: W8A16 UNet, fp16 CLIP-L and OpenCLIP-bigG encoders, embedding MLP, TAESDXL decoder (MNN), tokenizers, config |
v81/ |
4.31 GB in 14 files | Hexagon V81 set: W8A16 UNet, fp16 CLIP-L and OpenCLIP-bigG encoders, embedding MLP, TAESDXL decoder (MNN), tokenizers, config |
Each <arch>/ folder holds a complete set; manifest.json lists the files of each set with sizes and md5 checksums.
About the model
RealVisXL V4.0 Lightning is a photoreal SDXL fine-tune by SG_161222 in its few-step Lightning form; TokForge renders it in 6 deterministic Euler steps. This is the higher-quality 1024x1024 "Faithful" tier, alongside the SD1.5 NPU bundle (the "Fast" tier).
The model is quantized to W8A16 (8-bit weights, 16-bit activations) and compiled to QNN HTP context binaries that run on the phone's Hexagon DSP. The pipeline uses fp16 text encoders and a TAESDXL tiny-VAE decoder, runs 6-step EulerDiscrete, and is guidance-free (one UNet pass per step). No root is needed.
What runs where
| Stage | File |
|---|---|
| CLIP-L text encoder (fp16) | <arch>/text_encoder_1_fp16.bin |
| OpenCLIP-bigG text encoder (fp16) | <arch>/text_encoder_2_fp16.bin |
| Combined-emb MLP (host CPU) | <arch>/sdxl_emb_mlp.bin |
| UNet (W8A16, DSP) | <arch>/unet.bin |
| TAESDXL tiny-VAE (CPU MNN) | <arch>/taesdxl_decoder.mnn |
| Dual CLIP BPE tokenizers | <arch>/tokenizer/, <arch>/tokenizer_2/ |
The UNet and both text encoders run on the DSP. The app runs the pipeline through its libsdxl_qnn_driver.
Chips
The repo ships native sets for V73 / V75 / V79 / V81 (Snapdragon 8 Gen 2, 8 Gen 3, 8 Elite and 8 Elite Gen 5),
native 1024px (128x128 latent). These are compiled for the Hexagon DSP and are not a portable format like
GGUF. The app reads the device Hexagon arch (dsp_arch) and downloads the matching set.
Forward-compatibility (a lower-arch binary also runs on a higher-arch DSP) still applies as a fallback.
TokForge currently offers this route on V75 and V81 phones with 12 GB RAM or more. On other phones it uses its other image routes.
Render settings
| Setting | Value |
|---|---|
| Scheduler | EulerDiscrete (deterministic), trailing spacing, epsilon prediction |
| Steps | 6 |
| Guidance | guidance_scale 0 (guidance-free, one UNet pass per step) |
| Resolution | 1024x1024 |
| Decoder | TAESDXL on the CPU |
Reference photo support
The ip/ subfolder ships the IP-Adapter files for identity-preserving (reference-photo) rendering. When a
reference photo is attached, the driver swaps the base unet.bin for the IP-baked UNet (unet_ip.bin) and
renders with the reference's identity; no-reference renders are unchanged.
| File | What |
|---|---|
ip/v75/unet_ip.bin |
IP-Adapter UNet context binary, Hexagon V75 |
ip/v81/unet_ip.bin |
IP-Adapter UNet context binary, Hexagon V81 (built from the same DLC as V75; not yet checked on a V81 phone) |
ip/clip_vision_vith.mnn (+ .weight) |
CLIP ViT-H image encoder (CPU, MNN) for the reference photo |
ip/ip_resampler.mnn |
IP-Adapter plus-face Resampler (CPU, MNN) |
ip/ip_kv_proj.bin |
Packed 70x to_k_ip/to_v_ip projection weights for the CPU side |
ip/model_w8a16.dlc |
Arch-agnostic W8A16 QAIRT 2.40 DLC the per-arch unet_ip.bin are compiled from (source form, not downloaded by the app) |
ip/ip_kv_proj_weights.npz |
The same projection weights in .npz source form (k_0..k_69, v_0..v_69, inner[70], heads[70]; not downloaded by the app) |
The bins are identity-agnostic and safe to publish: the 70 cross-attention k_ip/v_ip are
render-constant inputs computed on the CPU per render (reference, then CLIP-ViT-H penultimate, then the
plus-face Resampler, then 70x to_k_ip/to_v_ip), so no likeness is baked into the published files.
The CLIP-ViT-H encoder + plus-face adapter weights come from the standard public
h94/IP-Adapter SDXL plus-face files, converted here for the NPU and CPU routes.
The app downloads these as optional bundle files (listed in the V75 and V81 sets' files map); their absence
degrades to a plain (no-identity) render and never fails the install. IO contract,
checksums, and per-arch details are in manifest.json under the top-level ip block.
How it was made
- Exported
SG161222/RealVisXL_V4.0_Lightning(diffusers) to graphs with a host-computed combined embedding (sdxl_emb_mlp.bin) and concatenated CLIP-L and OpenCLIP-bigG text embeddings. - Quantized the UNet to W8A16 and kept both text encoders at fp16 with QAIRT 2.40, then compiled one HTP context binary set per Hexagon arch from the same arch-agnostic DLC.
- Converted the TAESDXL decoder and the reference-photo CPU models (CLIP ViT-H, plus-face Resampler) to MNN.
Limitations
- This bundle is loaded automatically by the TokForge Android app; it is not a standalone diffusers checkpoint.
- Snapdragon only: the binaries need a Qualcomm Hexagon NPU, and TokForge offers the route only on the chips listed above.
- W8A16 quantization and the tiny-VAE decoder may change pictures slightly compared with the full-precision original.
- The reference photo carries the face only (IP-Adapter plus-face); ask for a scene where the face is visible, since a back view gives no recognizable likeness.
License
RealVisXL V4.0 Lightning (SG161222/RealVisXL_V4.0_Lightning) is under the
CreativeML OpenRAIL++-M license, plus SG_161222's Civitai terms for RealVisXL (credit required, no selling the model or merges of it).
The IP-Adapter files come from h94/IP-Adapter (Apache-2.0), the image encoder from OpenCLIP ViT-H-14 (MIT) and the tiny VAE from TAESDXL (MIT); see Credits.
The qnn_runtime/ files are Qualcomm software under Qualcomm's AI Stack License, not under the model license (see
Credits). TokForge 1.3.9 and later ship these libraries inside the app; earlier versions download them from this folder.
Credits
- RealVisXL V4.0 Lightning by SG_161222 (Civitai, Hugging Face). Used under the CreativeML OpenRAIL++-M license and the creator's Civitai terms. SG_161222's Civitai terms: credit required, no selling the model or merges of it.
- Stable Diffusion XL 1.0 by Stability AI (Hugging Face). Used under the CreativeML OpenRAIL++-M license.
- IP-Adapter by Tencent AI Lab (h94) (Hugging Face). Used under the Apache-2.0 license.
- OpenCLIP ViT-H-14 image encoder by LAION (Hugging Face). Used under the MIT license.
- TAESDXL tiny VAE by madebyollin (Hugging Face). Used under the MIT license.
- Compiled for the Hexagon NPU with Qualcomm AI Runtime (QAIRT) 2.40 by Qualcomm.
- Converted to MNN with MNN by Alibaba (Apache-2.0).
- The
qnn_runtime/files are Qualcomm AI Runtime (QAIRT) 2.40 runtime libraries by Qualcomm Technologies, Inc. They are Qualcomm software under Qualcomm's AI Stack License (theLICENSE.pdfshipped in the QAIRT SDK), not under the model license above, and are redistributed here for use inside the TokForge app only.
Model tree for darkmaniac7/TokForge-SDXL-QNN-NPU
Base model
SG161222/RealVisXL_V4.0_Lightning