Danbooru Corpus Maintenance
Refresh your Danbooru corpus from the live site and prep the LLM categorization pass
- categorization_system_prompt
- categorization_prompt
- review_system_prompt
- batch_token
- report
If Danbooru Prompt Forge is the front of Eclipse's Danbooru workflow, this is the maintenance bay behind it. Corpus Maintenance does two jobs: it pulls new posts from the live Danbooru API to keep the rating corpora fresh, and it prepares the two-pass LLM categorization batches that assign general tags to categories - or exports a provider-neutral manual work package instead. It's the node you queue periodically, not the one you wire into every generation.
Understand the context first. Prompt Forge reads offline taglist files; those files ship pre-built (four rating corpora, 100k posts each, plus a ~132k-tag categorized index, extracted at first startup). Maintenance is how you grow and curate that corpus yourself. That part needs a Danbooru account and API key, set under Eclipse → General → Danbooru Maintenance. No credentials are needed if you're happy with the shipped corpus or want to drop in your own lists from rainlizard/ComfyUI-Raffle - the node only requires them for online scraping.
How it works
The core is a resumable scraper with checkpoints. It walks /posts.json pages in score bands - the default automatic mode samples the 1024–5000 band first, then halves downward (512–1024, 256–512, …) until it finds unseen posts. Every response is committed before the next request, deduplicated by post ID, and appended to the matching rating file, up to target_per_rating (capped at 100,000). Then it enriches from the /tags.json catalog, publishes authoritative artist/character/copyright/meta tags directly, and funnels only uncategorized general tags into an ordered backlog for LLM categorization. A global 3,000-request safety cap per run keeps you from hammering the API.
The actions chip bar selects the phases: refresh_ratings, optional catalog-only refresh_catalog, mutually exclusive prepare_ai or manual_categorization, and resume. On an imported corpus you can run catalog enrichment alone by turning off refresh_ratings.
Inputs worth knowing
actions/ratings- the combo-chip bars at the top. Everything on this node runs from those.target_per_rating- how many unique posts to retain per rating. Existing larger corpora are never truncated.score_range_mode-automatic(adaptive bands) orcustom(one fixedcustom_score_min/custom_score_maxrange).excluded_post_tags- deny any newly returned post containing an exact listed tag. Whole-tag matching only: excludingrapedoes not excludegrape.ai_batch_size/maximum_ai_batches- tags per SmartLLM request (default 100) and how many batches to prepare per queue.
The AI categorization path
When prepare_ai is selected, the node emits the four outputs that drive a two-pass LLM pipeline: categorization_system_prompt and categorization_prompt feed Smart LM Loader #1, whose output feeds Loader #2's user_prompt; review_system_prompt feeds Loader #2's system_prompt; and batch_token goes to Danbooru Category Apply. That requires the separate ComfyUI SmartLLM pack. The author's tested recipe: a Qwen 3.x instruct model in the 8B/9B class or larger (Qwen 3.8 27B is the strongest tested; Qwen 3.5 9B is the smallest that's exact-preserving), greedy decoding (do_sample=false, num_beams=1), text-only, no Multi-Task. The pack docs name specific models that failed this job - Ministral 3, abliterated Gemma 3 4B, Qwen 2.5 VL 3B - so trial anything else at ai_batch_size 50 or lower first.
No local LLM, no SmartLLM? Pick manual_categorization instead and the node writes a complete, provider-neutral export under prompts/tag_lists/manual_categorization/export-<hash>/ - prompts, rules, numbered inputs - that a remote chat model or agent can process. Eclipse only prepares that package; consuming the results is on you.
Install and gotchas
Same pack as Prompt Forge: ComfyUI Manager → search "Eclipse", or git clone https://github.com/r-vage/ComfyUI_Eclipse custom_nodes/ComfyUI_Eclipse and restart. The maintenance half additionally wants ComfyUI SmartLLM installed.
Real-world traps:
- Resume is your friend. Checkpoints are per-rating, per-score-band, saved after every response. Turning
resumeoff rewinds to page 1, and rewinding only works when the complete checkpoint prefix exists. A network failure that kills a run never loses earlier committed pages. - Credentials go in Eclipse's private
config.json, never into workflow JSON or manifests. Clearing the login or API key removes the stored value. - Batch manifests expire after seven days. Prepared AI batches older than that get rejected by Category Apply; just re-queue to prepare fresh ones.
- Batch files get two-generation backups under
prompts/tag_lists/.backups/- if a commit hiccups, your corpus isn't silently corrupted. - For a true fresh start, delete the whole
prompts/tag_lists/directory; Maintenance restores the contracts and empty rating files, and collection restarts from zero.
It's a fiddly node with a lot of knobs, but once it's running it's genuinely set-and-forget: it commits as it goes, respects the API, and picks up where it left off.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| actions | STRING | refresh_ratings,prepare_ai,resume | Maintenance phases selected by Eclipse's combined maintenance and rating combo-chip bar. |
| ratings | STRING | general,sensitive,questionable,explicit | Rating corpora selected by Eclipse's combined maintenance and rating combo-chip bar. |
| post_start_page | INT | 11–1000000000 | First logical request for every selected rating. Resume uses each rating's saved score band and request checkpoint; disable resume to rewind only when the preceding checkpoint exists. |
| post_stop_page | INT | -1-1–1000000000 | Last logical post page to scan for each rating, inclusive. Use -1 to continue until the rating target, score range end, or the post-phase request window reserved ahead of catalog enrichment. |
| target_per_rating | INT | 1000001–100000 | Maximum number of unique posts retained for each selected rating. Existing larger imported corpora are not truncated. |
| score_range_mode | COMBO | automatic | Automatic samples scores 1024 through 5000 first, then halves downward whenever a sample finds no unseen posts. Custom samples one fixed inclusive range. Each request uses the selected rating pool with the fewest retained posts. |
| custom_score_min | INT | 0-1000000000–5000 | Inclusive minimum Danbooru post score used in custom mode. |
| custom_score_max | INT | 5000-1000000000–5000 | Inclusive maximum Danbooru post score used in custom mode. |
| minimum_tag_post_count | INT | 1000–1000000000 | Before SmartLLM, inspect catalog tags with more posts than this value and keep only tags present in the rating pools. |
| tag_start_page | INT | 11–1000 | First catalog-enrichment page. Resume restores the saved page; disabling it permits a checkpointed rewind. |
| tag_stop_page | INT | -1-1–1000 | Inclusive catalog stop page, or -1 for exhaustion. |
| maximum_tag_pages_per_queue | INT | 1001–1000 | Catalog-page request budget reserved after post collection and before SmartLLM preparation. |
| ai_batch_size | INT | 1001–500 | General tags placed in each SmartLLM request or numbered manual-categorization input file. |
| maximum_ai_batches | INT | 11–32 | Maximum mapped SmartLLM batches prepared per queue. Ignored and hidden for manual categorization exports. |
| excluded_post_tags | STRING | Deny newly returned posts containing any exact tag listed here, separated by commas or new lines. Adjacent separators, blank entries, and duplicate entries are ignored; at most 1000 tags of 255 characters each are allowed. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| categorization_system_prompt | STRING | Connect to Smart LM Loader #1 system_prompt. |
| categorization_prompt | STRING | Connect to Smart LM Loader #1 user_prompt. |
| review_system_prompt | STRING | Connect to Smart LM Loader #2 system_prompt. |
| batch_token | STRING | Connect to Danbooru Category Apply batch_token. |
| report | STRING | Refresh and pending-work report. |