Downloads · 30 days
93
30% of all-time downloads
LoliRimuru/BooruPromptGenerator
BooruPromptGenerator is a machine learning model from LoliRimuru. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A Transformer tag language model trained on Danbooru-style metadata that generates coherent tag prompts.
Downloads · 30 days
93
30% of all-time downloads
All-time downloads
310
Public
Parameters
16.4M
131 MB on disk
Likes
6
Trending 1
Click a slice to open those files.
.pt65.8 MB · 50%
From the Hugging Face model README
A Transformer tag language model trained on Danbooru-style metadata that generates coherent tag prompts.
model.safetensors — model weightsconfig.json — model architecture / generation defaultsvocab.json — tag vocabularycounts.json — per-tag occurrence countsmutex.json — mutually exclusive tag pairsmodel.py — self-contained model + samplerinference.py — command-line generatorpip install -r requirements.txt
For the RTX 5090 / CUDA 13.x setup used during training, install the matching PyTorch wheel, e.g.:
pip install torch==2.12.1+cu130 --index-url https://download.pytorch.org/whl/cu130
# Empirical mode (follow Booru distribution)
python inference.py --mode empirical --count 10 --length 30
# Diverse mode (boost rare tags)
python inference.py --mode diverse --count 10 --length 30
# Anchor + blacklist + content rating
python inference.py \
--mode empirical --count 5 --length 30 --rating s \
--anchor "1girl,black_hair" --blacklist "1boy,smile"
# Constrained sampling (top-k / nucleus)
python inference.py \
--mode empirical --count 5 --length 30 \
--temperature 0.8 --top-k 50 --top-p 0.95
| Flag | Default | Description |
|---|---|---|
--mode | — | empirical (alpha=0) or diverse (alpha=1) |
--alpha | 0.0 | Fine-grained distribution coefficient (0=empirical, 1=diverse) |
--rating | g | Content rating token: g (general), s (sensitive), q (questionable), e (explicit) |
--count | 10 | Number of prompts to generate |
--length | 30 | Tags per prompt, maximum 128 |
--anchor | — | Comma-separated tags that must appear in every prompt |
--blacklist | — | Comma-separated tags the model must not generate |
--min-prob | 0.0005 | Minimum raw model probability for a candidate tag |
--temperature | 1.0 | Sampling temperature: lower = more focused, higher = more random |
--top-k | 0 | Top-k sampling: keep only the k most likely tags. 0 disables it |
--top-p | 1.0 | Nucleus / top-p sampling: keep the smallest set whose cumulative probability exceeds p. 1.0 disables it |
--distribution-weight | 0.75 | Strength of the empirical/diverse bias applied to model scores |
--seed | — | Random seed for reproducible generation |
vocab.json are ignored for anchor/blacklist.