Style Pad
日本語の説明は README_ja.md にあります。
Style Pad is a tool for exploring drawing styles as a map. The styles of about 62,000 illustrators (Danbooru artists) were measured and laid out in one continuous "style space". You move a point through that space with a pad and sliders, and an SDXL anime model redraws the same picture in the style at that point, a few times per second. Because the picture and its composition stay fixed, only the style changes as you drag.
Every point in the space is a usable style, not only the points where real artists sit. You can start from a known artist and drift away, blend two styles, or draw random points and keep the ones you like.
Non-commercial use only. Images generated with Style Pad may not be used commercially either (see Licenses). There is no content filter: depending on the prompt and the style, explicit images can appear.
What you can do with it
Look around the space of styles. Drag on the pad and watch the picture change. Neighbouring points look similar, distant points look different, so you can follow a direction (thicker lines, flatter colours, more painterly…) and stop wherever you like.
Start from an artist. Type part of an artist's name (the Danbooru artist tag) into the artist box. Choosing an artist moves the point to that artist's centre, which is the average style of that artist's illustrations, and the picture is redrawn in that style. From there you can move away and look for variations around the artist.
See which artists are close. For whatever point you are at, the artist panel lists the ten nearest artists with their distance. The picture itself is never "by" a particular artist: it is a style at a position in the space, and the list tells you whose work lies nearest to that position.
Draw random styles. The gacha button picks a random real artist and moves slightly away from them; the adventure setting controls how far (0 = exactly the artist's centre, larger = further away). You can also limit the draw to artists marked ★ (see below), or draw from synthetic points that imitate the overall distribution instead of real artists. Each result shows the artist it started from and the nearest artist, and all draws are kept in a history (♥ to mark favourites).
Blend two styles. Register the current style as A, move somewhere else and register it as B; a slider then moves smoothly between them, and can even go past either end.
Save and share a style. Each point can be copied as a short text code (for example SP3:…). Pasting the code back
into Style Pad restores exactly the same style.
Change the picture. The prompt is free text (Danbooru-style tags work best), so you can look at the same style on your own subject. A list of ready-made prompts is also included.
How the pad is organised
The space has 32 axes. They are not hand-made sliders such as "line weight" or "colour": they were found automatically by a linear discriminant analysis (LDA), which looks for the directions in which artists differ from each other most consistently. Axis 1 is the direction that separates artists best, axis 2 the next best, and so on. For that reason the axes have numbers, not names; what each one does is easiest to learn by moving it and watching.
- The pad's left–right (X) and up–down (Y) control axes 1 and 2 by default. Two more axes (Z and W, by default axes 3 and 4) are moved with Shift- or Control-drag and shown as the size and colour of the ring. Any axis can be assigned to X/Y/Z/W.
- Every axis also has a slider. The pad and the sliders are linked.
- Distances are measured in units of how widely real artists are spread along each axis, so ±1 on any axis is a typical difference between artists and ±3 is already unusual.
- The dots on the pad are the artists' centres.
Where the styles can be used
Style Pad draws with its own pipeline: NoobAI-XL 1.1 (an SDXL anime model) plus a style adapter that turns a point in the style space into conditioning for the model. The styles you find live inside this app. A style code is not a LoRA or a prompt, and it cannot be loaded into other models or services.
What you can take elsewhere is the list of nearby artists. Many image models respond to artist names written as tags. An artist marked ★ is one whose tag NovelAI is known to recognise, so writing the names of nearby ★ artists in a NovelAI prompt is an indirect way to approach a style you found. With NoobAI-XL and other Danbooru-trained models, artist tags often work as well. The result will not be identical to what Style Pad shows: a tag calls up what that model learned about the artist, while Style Pad uses the measured average style.
Run it on your computer
You need a Linux machine with an NVIDIA GPU (peak VRAM about 8 GB at 768–1024 px; developed on a 12 GB RTX 4070 Ti), recent CUDA 13 drivers and Python 3.10. Mac is not supported. On first start the app downloads the base model and the other parts from Hugging Face (about 7.6 GB; the Python packages take another ~6 GB).
1. Make a Python environment
python3.10 -m venv style-pad-venv
source style-pad-venv/bin/activate
2. Get this repository (pick one)
(A) With the Hugging Face CLI
command -v hf >/dev/null || python -m pip install "huggingface_hub==1.33.0" # install the `hf` command only if missing
hf auth whoami >/dev/null 2>&1 || hf auth login # log in only if not logged in yet (optional)
hf download cloudaiman/style-pad-xl-preview --local-dir style-pad
The repository is public, so logging in is optional (it only raises the download rate limit).
(B) With git, no CLI
git clone https://huggingface.co/cloudaiman/style-pad-xl-preview style-pad
git-lfs is optional. Without it, the weights and app/data/*.npz arrive as small pointer files, and the app downloads
the real files from this repository on first start (about 230 MB).
(C) With Python only, no CLI
python -m pip install "huggingface_hub==1.33.0"
python -c "from huggingface_hub import snapshot_download; snapshot_download('cloudaiman/style-pad-xl-preview', local_dir='style-pad')"
3. Install and start
cd style-pad
pip install --extra-index-url https://download.pytorch.org/whl/cu130 -r app/requirements.txt
python app/app.py --host 127.0.0.1 # then open http://localhost:7860
Several browsers can connect at once: one person controls the pad at a time, the others wait in line and watch the live image. The interface can be switched between English and Japanese.
- The weights at the root of this repository are found automatically (or set
WEIGHTS_DIR=/path/to/folder). Third-party parts are downloaded from the Hugging Face Hub at pinned revisions; no login is needed. - The default edition (
local) has free prompt text, no NSFW filter and the artist features.--edition spaceis the variant for a public server: fixed all-ages prompt list (app/prompts.json), NSFW blur (needsnsfw_head.safetensors) and synthetic dots instead of artists. --dry-run: no GPU, flat colour images (for UI work).--res 768 --steps 4(defaults),--res-choices 768,896,1024,--step-choices 2,4(supported: 640/768/896/1024/1152 px, 1/2/4 steps),--turn-sec 180,--idle-sec 30,--tb-f 2,--w-rho 1 --w-cap 3,--nsfw-threshold 0.55,--exit-idle-min N,--max-min N.app/Dockerfileis a container recipe for the same server (GPU required).
Technical details
How a point becomes a picture
pad z (32 axes, in units of the spread of real styles)
→ LDA coordinates (axes 33–768 held at the mean)
→ CSD style vector (768-d, inverse LDA) app/stylepad/codes.py
→ [optional pre-map] → [whitening w2] → unit length
→ csd2clip MLP → CLIP image-embedding space (1280-d)
→ image_proj of the Style IP-Adapter → 4 tokens app/stylepad/ipa.py
→ decoupled cross-attention in every attn2 layer of the UNet, per-layer gate,
low-rank delta on the IP-Adapter k/v app/stylepad/attn.py
NoobAI-XL 1.1 (fp16) + DMD2 4-step LoRA (fused) + LCM scheduler, CFG 1, 1/2/4 steps,
TAESDXL decoder, fixed initial noise (seed 1000) app/stylepad/render.py
- Style space. CSD-ViT-L style embeddings of the illustrations of about 62,000 Danbooru artists were averaged per
artist, and an LDA was fitted to those averages. The pad moves the first 32 LDA axes. The artist centres are in
app/data/artists.json. - Point → image. The Style IP-Adapter for NoobAI-XL normally takes a CLIP image embedding of a reference picture. Here a small MLP (csd2clip) maps the CSD vector into that CLIP space; it was trained on pairs of CSD and CLIP-bigG (448 px) embeddings of the same images. No reference image is used.
- Whitening w2 stretches weak LDA axes (factor ≤ 3) so that every pad axis has a visible effect. t-boost multiplies the style strength during the early (high-noise) steps. The pre-map options are an experimental linear correction (cov_match v2). Defaults: w2 on, t-boost ×2, no pre-map.
- Gacha. For a real artist with centre c and adventure h ≤ 1: z = √(1−h²)·c + h·(|c|/√32)·noise, so h = 0 is exactly the centre and h = 1 keeps only the distance from the middle; 1–2 = plain random with a wider spread. Synthetic dots are Gaussian-mixture samples imitating the artist distribution.
- Codes.
SP3:+ base64url of int8(z×20) for 32 axes; olderSP2:20-axis codes load with axes 21–32 at 0. - The server writes nothing to disk; logs go to stdout.
Files
| File | Contents |
|---|---|
style_pad_s0.safetensors | the trained part of the style adapter, keys unchanged from the training code: conv.* (csd2clip MLP 768→2048→2048→1280), proj.* / norm.* (image projection 1280 → 4×2048 + LayerNorm, initialised from the Style IP-Adapter), gates (70 per-layer gates), kv.{0..69}.{kd,ku,vd,vu}.weight (rank-64 deltas on the IP-Adapter k/v). Checkpoint s0 (step 0) of a 50-source run: the csd2clip and IP-Adapter weights before fine-tuning, with gates 0.8 and zero up-projections. |
csd2clip.safetensors | the csd2clip MLP that is actually used (conv.*, identical to the copy in style_pad_s0) plus its standardization statistics x_mu, x_sd (CSD), y_mu, y_sd (CLIP), dev_norm, hidden. |
nsfw_head.safetensors | only for --edition space (not loaded by default). Linear head (weight [768], bias) on L2-normalized CLIP ViT-L/14 image embeddings: sigmoid(e·w + b) = NSFW score. Logistic regression on 16k Danbooru posts (12,800 for training, 3,200 held out; negative: general, sensitive; positive: questionable, explicit). Frames above 0.55 are blurred (metadata app_default_threshold); threshold_train_rule = 0.27 is the stricter value picked by the training script, not used by default. Held-out blur rates at 0.5 / 0.6: general 0.7 / 0.4 %, sensitive 20 / 14 %, questionable 83 / 80 %, explicit 96 / 96 % (AUC 0.995). |
app/ | the server (aiohttp + WebSocket), the UI (app/static/ui.html, no external scripts), style-space data (app/data/), prompt list, requirements.txt, Dockerfile |
app/data/artists.json | 61,842 artists: name (Danbooru artist tag), NovelAI-known rank (≥ 0 = ★) and the centre on the first 32 standardized LDA axes (int8, ×20), built from the mean CSD style of each artist's images. No images, captions, post ids or URLs. 3.7 MB |
app/data/anon_points.json | synthetic dots (Gaussian-mixture samples imitating the artist distribution) |
demo/hf_demo_preview.gif | the animation above |
The frozen IP-Adapter k/v (to_k_ip, to_v_ip) are not included; they are loaded from
r3gm/noob-ipa at run time. Input of the adapter: a raw CSD-ViT-L style vector,
unit length, version csd-vit-l:5bc26a6fb0487f3f00a2a7313135103a005b1b67:preview1024-clip224-v1.
Where to start modding
app/prompts.json: the prompt list shown in the UI.app/stylepad/codes.py: how a pad position becomes a style vector (axes, whitening, pre-map).app/stylepad/render.py: the sampler (steps, timesteps, scheduler, decoder, t-boost).app/stylepad/ipa.py,app/stylepad/attn.py: how the style vector enters the UNet.app/app.py: queue and turn rules, request validation, WebSocket protocol (set/frame/queue/status).app/static/ui.html: the whole UI.
Licenses
| Component | Source | License |
|---|---|---|
| Base model NoobAI-XL 1.1 | Laxhar/noobai-XL-1.1 (rev 814a274) | FAIPL-1.0-SD plus the authors' additional terms: no harmful, illegal or unethical generation; no commercial use of any kind, including the model, derived models and generated images; derivatives must be open-sourced with their methods shared; no warranty |
| DMD2 SDXL 4-step LoRA | tianweiy/DMD2 dmd2_sdxl_4step_lora_fp16.safetensors (rev be22767) | CC BY-NC 4.0 |
| TAESDXL decoder | madebyollin/taesdxl (rev b20258a) | MIT |
| Style IPAdapter for NoobAI-XL | Civitai model 1233692 by VahlokAlunmid, a fine-tune of NoobAI IPA Mark1; file from the mirror r3gm/noob-ipa model_G/styleIpadapterFor_v10.safetensors (rev 534fdd8) | Civitai permissions: no credit required (credited here anyway), derivatives allowed, derivatives may use a different license, commercial use only via RentCivit |
| CSD-ViT-L style encoder | tomg-group-umd/CSD-ViT-L (paper: Measuring Style Similarity in Diffusion Models) | weights CC BY 4.0, code MIT |
| NSFW filter backbone (space edition only): CLIP ViT-L/14 | openai/clip-vit-large-patch14 (rev 32bd642), image tower only, plus our linear head nsfw_head.safetensors | MIT (head: this project) |
| CLIP image encoder (ViT-bigG) | h94/IP-Adapter sdxl_models/image_encoder. Only used to make training targets for csd2clip, not at run time | Apache-2.0 |
| Style Pad weights and code (this repository) | this project | non-commercial use only, following the licenses above; open source as required by the NoobAI-XL terms |
The CSD encoder and the CLIP-bigG image encoder are not needed to run the app: the pad produces CSD vectors directly. Because of the NoobAI-XL terms and DMD2 (CC BY-NC 4.0), images generated with Style Pad may not be used commercially.