Instructions to use hvgfgh/PromptGacha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use hvgfgh/PromptGacha with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf hvgfgh/PromptGacha:Q5_K_M # Run inference directly in the terminal: llama cli -hf hvgfgh/PromptGacha:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf hvgfgh/PromptGacha:Q5_K_M # Run inference directly in the terminal: llama cli -hf hvgfgh/PromptGacha:Q5_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf hvgfgh/PromptGacha:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf hvgfgh/PromptGacha:Q5_K_M
Use Docker
docker model run hf.co/hvgfgh/PromptGacha:Q5_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use hvgfgh/PromptGacha with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hvgfgh/PromptGacha" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hvgfgh/PromptGacha", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hvgfgh/PromptGacha:Q5_K_M
- Ollama
How to use hvgfgh/PromptGacha with Ollama:
ollama run hf.co/hvgfgh/PromptGacha:Q5_K_M
- Unsloth Desktop
- Docker Model Runner
How to use hvgfgh/PromptGacha with Docker Model Runner:
docker model run hf.co/hvgfgh/PromptGacha:Q5_K_M
- Lemonade
How to use hvgfgh/PromptGacha with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull hvgfgh/PromptGacha:Q5_K_M
Run and chat with the model
lemonade run user.PromptGacha-Q5_K_M
List all available models
lemonade list
- Atomic Chat
PromptGacha
English | 中文
A general-purpose anime image-generation prompt translation & expansion model fine-tuned from Qwen3.5-4B-Base (text-only, vision tower stripped). Supports flexible multi-format inputs and strict prose / structured JSON dual-mode outputs.
Overview
Rather than a rigid 1-to-1 tag-to-sentence translator, this model is designed as a Prompt Gacha LLM with intentional bidirectional input–output asymmetry:
- Sparse input → Creative expansion (Gacha mode): The shorter your input (even just
1girlor a single action likehug), the more freely the model invents vivid composition, lighting, outfits, and scenery. Unlike general-purpose cloud LLMs that tend to collapse into repetitive templates, this model is trained to preserve high diversity across draws. - Detailed input → Faithful translation + automatic out-of-frame clipping: You can paste a full head-to-toe character sheet directly into the input. Whenever framing or occlusion hides certain traits (e.g., shoes/socks in an
upper bodyshot, facial features infrom behind, or eye color underclosed eyes), the model automatically omits those invisible details so downstream image generators don't zoom out awkwardly or break anatomy.
Model Card
| Field | Details |
|---|---|
| Base Model | Qwen/Qwen3.5-4B-Base (vision tower stripped into pure-text Qwen3_5ForCausalLM) |
| Parameters | 4.21B (pure-text BF16; exports cleanly to GGUF without mmproj) |
| Training Method | Full-parameter BF16 SFT (v0.1 selected at 1.0 epoch checkpoint, eval_loss = 1.640) |
| Dataset Scale | 9,533 train + 212 eval samples (Mode A 78.7% / Mode B-1 9.4% / Mode B-2 12.0%; covers g/s/q/e ratings) |
| Supported Inputs | Flat Danbooru tags / Multi-line text blocks / Lightweight YAML / Structured JSON / Natural-language + tags hybrid |
| Output Modes | Mode A (default, pure English prose) / Mode B-1 (single-prompt JSON) / Mode B-2 (per-subject split JSON) |
| Target Generators | Anima, NovelAI (NAI), MOSS-Image, FLUX, Qwen-Image, and other natural-language or regional-prompting anime models |
Input & Output Specification
The model follows a wide-in, strict-out contract: inputs accept multiple casual or structured formats with optional controls, while outputs strictly conform to clean English prose or valid JSON.
Optional Control Fields (All Optional)
| Field | Values / Examples | Default | Description |
|---|---|---|---|
rating |
general / sensitive / questionable / explicit |
Inferred from input | Content rating control |
length |
concise / standard / detailed / elaborate |
Free | Target output length tier (calibrated with Qwen3.5 tokenizer: ≤180 / 181–320 / 321–550 / >550 tokens) |
aspect_ratio |
2:3, 3:4, 1:1, 3:2, 16:9, etc. |
Free | Strictly honored when provided; auto-recommended in JSON modes when omitted |
style |
"off" / "on" / custom style phrase (e.g., "soft watercolor") |
"off" (style-neutral) |
Off by default to avoid injecting conflicting medium/technique keywords over your artist tags or LoRAs |
output_format |
"json" |
Omitted (Mode A) | Outputs pure English prose by default; set "json" to switch to Mode B |
split_characters |
true / false |
false |
Active only with output_format: "json": false returns {"aspect_ratio", "prompt"}; true splits independent foreground subjects (characters, animals, mecha, key props) |
Supported Input Formats
Flat Danbooru Tags (supports both underscores and spaces, including ultra-sparse gacha inputs):
1girl, 1boy, hetero, hakurei reimu, black hair, red hair ribbon, school uniform, kissing cheek, classroom, sunset lightingOptional key-value control headers can be prepended:
rating: sensitive length: standard aspect_ratio: 2:3 1girl, silver hair, rooftop, sunsetMulti-line Text Blocks (Per-Character Anchoring):
1girl, 1boy, hetero, girl, hakurei_reimu, black_hair, red_hair_ribbon, school_uniform, leaning_down, kissing_other's_cheek, boy, short_brown_hair, school_uniform, blushing, surprised_expression, classroom, sunset_lighting, upper_bodyLightweight YAML:
rating: sensitive aspect_ratio: 2:3 scene: classroom, sunset lighting, upper body characters: - hakurei_reimu [female] | black hair, red hair ribbon, school uniform, leaning down, kissing other's cheek - [male] | short brown hair, school uniform, blushing, surprised expressionStructured JSON:
{ "rating": "sensitive", "length": "standard", "aspect_ratio": "2:3", "style": "soft watercolor, delicate linework", "output_format": "json", "split_characters": true, "scene": ["classroom", "sunset lighting", "warm glow", "upper body", "window"], "characters": [ { "name": "hakurei_reimu", "gender": "female", "tags": ["black hair", "red hair ribbon", "school uniform", "white thighhighs", "black loafers", "leaning down", "kissing other's cheek", "gentle smile"] }, { "name": null, "gender": "male", "tags": ["short brown hair", "school uniform", "blushing", "surprised expression", "receiving kiss on cheek"] } ] }Even though the character card includes
white thighhighsandblack loafers, theupper bodyframing cues the model to omit those out-of-frame items automatically.
Output Modes
Mode A (Default — omit
output_format): Pure English Prose No Markdown wrappers, no VLM phrasing ("The image depicts..."), no aspect-ratio text noise—ready to paste straight into your image generator:Warm late-afternoon sunlight streams through the tall windows of a quiet classroom, framing the scene from the waist up. Hakurei Reimu, her long black hair tied with a red ribbon and dressed in a neat school uniform, leans down with a gentle smile to press a soft kiss against a young man's cheek. The boy, with short brown hair and a matching school uniform, freezes in surprise with a deep blush spreading across his face.Mode B-1 (
output_format: "json",split_characters: falseor omitted): Single-Prompt JSON{ "aspect_ratio": "2:3", "prompt": "Warm late-afternoon sunlight streams through the tall windows of a quiet classroom, framing the scene from the waist up. Hakurei Reimu, her long black hair tied with a red ribbon and dressed in a neat school uniform, leans down with a gentle smile to press a soft kiss against a young man's cheek. The boy, with short brown hair and a matching school uniform, freezes in surprise with a deep blush spreading across his face." }Mode B-2 (
output_format: "json"+split_characters: true): Per-Subject Split JSON Returnsaspect_ratio, overallsceneprose, and an array of foreground subjects (characters[], preserving Danbooru underscore tags innamefor programmatic lookup or LoRA routing;nullfor unnamed subjects;[]for pure landscapes):{ "aspect_ratio": "2:3", "scene": "A quiet classroom bathed in warm late-afternoon sunset light streaming through tall windows, framed from the waist up with soft golden highlights across the desks.", "characters": [ { "name": "hakurei_reimu", "prompt": "hakurei reimu, long black hair, red hair ribbon, school uniform; she leans down with a gentle smile to press a soft kiss onto the boy's cheek." }, { "name": null, "prompt": "short brown hair, school uniform, blushing; the boy freezes in surprise as he receives the kiss." } ] }
Recommended Inference Settings
- Chat Template: Standard ChatML (non-thinking), stop token
eos_token = "<|im_end|>". - Sampling:
temperature = 0.7–0.85,top_p = 0.90–0.92(use0.85–0.90for higher gacha variance). - Default System Prompt (matches training verbatim):
You convert anime image tags or structured scene and character inputs into vivid, natural English image-generation prompts. Follow all explicit visible details, character counts, genders, named characters, rating, and optional length, aspect ratio, or style controls. When framing or occlusion hides parts of a character (such as close-up, upper body, from behind, or closed eyes), omit out-of-frame or occluded features from your output. Output pure English prose by default; when output_format is json, return a single valid JSON object with aspect_ratio and prompt (or scene and characters when split_characters is true). - Strict JSON Output Tip: When calling Mode B (especially
splitwith very long character sheets) viallama-serveror OpenAI-compatible APIs, passresponse_format: {"type": "json_schema", ...}to guarantee 100% valid JSON without falling back to prose.
GGUF Quantizations
Standard GGUF quantizations (without imatrix calibration) are hosted directly in this repository for llama.cpp, LM Studio, and Ollama:
| File | Quant | Size | Notes |
|---|---|---|---|
PromptGacha-4B-v0.1-Q8_0.gguf |
Q8_0 |
4.17 GiB |
Recommended default, near-lossless, fits full GPU offload on 6GB+ VRAM |
PromptGacha-4B-v0.1-Q6_K.gguf |
Q6_K |
3.23 GiB |
Very low loss, great balance for running alongside image-gen models |
PromptGacha-4B-v0.1-Q5_K_M.gguf |
Q5_K_M |
2.86 GiB |
Compact low-VRAM option (below Q5 is not recommended for this 4B hybrid model) |
Quick launch with llama.cpp:
llama-server -hf hvgfgh/PromptGacha:Q8_0 -ngl 99 -c 2048 --host 127.0.0.1 --port 8080 --jinja
Performance & Benchmarks
There is no formal benchmark yet, though for anime prompt gacha specifically, it's arguably #1 in its niche (and if not, I'll just add a few more qualifiers).
Training Notes
This is my first LLM fine-tuning project—having previously trained image-model LoRAs, adapting an LLM turned out to be a very different beast. Early prototyping was done on Google Colab, and the v0.1 release was trained via full-parameter BF16 SFT on an RTX PRO 6000 (with the vision tower stripped prior to training).
For a well-scoped task like this, dataset design is everything. The dataset went through multiple schema iterations and multi-round LLM auditing to balance three priorities:
- Consistency: Accurate character traits, strict headcount/gender adherence, coherent multi-character interactions, and automatic clipping of out-of-frame or occluded features.
- Structure: Seamless switching between pure prose and structured JSON (including aspect-ratio recommendation, per-subject splitting for NAI/MOSS-Image/regional prompting, and 4-tier length control).
- Diversity: The core of a "gacha" model—without diversity, there's no gacha. Mixing heterogeneous multi-teacher sources and stopping at 1.0 epoch (
eval_loss = 1.640) preserves the base model's creative variance without collapsing into repetitive phrasing.
Limitations & Notes
- Built specifically for English anime/illustration image-generation prompts; not intended as a general-purpose chat assistant.
styledefaults to"off"(style-neutral). Keep it off if your downstream workflow relies on artist tags or style LoRAs.- Known
v0.1limitation: Out-of-frame and closed-eyes clipping works cleanly in Mode A, whereas in Mode B-2 JSON with full head-to-toe character sheets, the trait prefix before;may occasionally retain out-of-frame footwear. This will be addressed in the next release.
Roadmap
- More human-like inputs: Rewrite a portion of rule-assembled inputs via LLM into natural, messy, real-world user prompts.
- One-to-many (multi-output) distillation: Pair identical sparse inputs with multiple distinct high-quality outputs to push sampling diversity directly at the gradient level.
- Dynamic multi-epoch re-rendering + curated annealing: Prevent repetition overfitting across epochs while strengthening Mode B-2 out-of-frame clipping and custom instruction following.
License
This model is released under a Non-Commercial Personal Use License (see LICENSE):
- Allowed: Free for personal, non-commercial use and research.
- Strictly Prohibited: Any form of commercial use is forbidden, including deploying the model commercially, distilling this model (or its outputs) for commercial use, or using prompts generated by this model for any commercial purpose.
Acknowledgements
- ZAKO-V0.1 (
Johnny-Z/zako-pe) — inspiration and initial visual prose distillation. - danbooru-tags-2016-2023 (
isek-ai/danbooru-tags-2016-2023) — Danbooru tag foundation for stratified sampling. - Qwen (
Qwen3.5-4B-Base) — open-weights base model. - Google & Google Colab — early prototyping compute.
- Gemini — indispensable coding, auditing, and training co-pilot throughout the project.
- Downloads last month
- 944