/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
Qwen3.5-text-4B-bnb-4bit
Библиотека
transformers
Опубликована
3 окт 2026

Qwen3.5-4B-Danbooru-Prompt-Generator

Генерация текстаТекст → текст

Текстовая Qwen3.5-4B, которая расширяет начальные теги Danbooru в промпты для генерации изображений.

620скачиваний за 30 дней2лайкавеса обновлены4 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Qwen3.5-4B-Danbooru-Prompt-Generator — текстовая модель для расширения начальных тегов Danbooru в набор тегов для генерации изображений. Модель создана на базе techwithsergiu/Qwen3.5-text-4B-bnb-4bit и дообучена для этой задачи; доступны объединённые веса BF16 в Safetensors и сборка GGUF. В карточке указана лицензия Apache-2.0.

На вход подаются теги через запятую, многословные теги записываются через подчёркивания. Модель добавляет связанные описательные теги, понимает отрицания с префиксом «-» и команды рейтинга rating:general и rating:explicit. Предусмотрен узел ComfyUI для работы с локальным сервером LM Studio; для него требуется отключить режим рассуждений в шаблоне чата. Модель принимает текст и выдаёт текстовые теги, изображения на вход не принимает.

Сильная сторона модели — генерация тегов в формате Danbooru с контролем рейтинга и семантическими отрицаниями. Обучающие данные преимущественно содержали NSFW-примеры, поэтому возможен уклон к откровенному контенту; указание rating:general и отрицательных тегов не гарантирует безопасный результат, его следует проверять. BF16 требует около 8,4 ГБ памяти под веса плюс KV-кэш; GGUF рассчитан на меньшую потребность в памяти.

Сценарии применения

  • расширение тегов Danbooru для промпта генерации изображения
  • добавление описательных тегов аниме-персонажу
  • генерация тегов с ограничением рейтинга general или explicit
  • исключение нежелательных понятий из набора тегов
  • подключение генератора тегов к рабочему процессу ComfyUI

Ограничения

Обучение преимущественно на NSFW-данных может смещать результаты к откровенному содержимому; rating:general и отрицательные теги не гарантируют безопасный вывод, поэтому его нужно проверять. Для узла ComfyUI требуется совместимый API LM Studio и отключённый режим рассуждений; BF16 требует около 8,4 ГБ памяти под веса плюс KV-кэш.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3.5-4B-Danbooru-Prompt-Generator

Expand a few Danbooru seed tags into a full image-generation prompt. Ships as a merged text-only Qwen3.5 model (BF16 + GGUF) and a ComfyUI node that talks to a model server over HTTP. The node is built for LM Studio: load the model there and the node handles the rest.

Key features

  • Semantic negation. Prefix a concept with - (e.g. -nude) and the model avoids that concept and related tags.
  • Danbooru tag output. Tags go in as a user chat message, comma-separated tags with underscores come out (looking_at_viewer).
  • Rating control. Write rating:general or rating:explicit, exactly like that.
  • Chat template. Use the supplied template with thinking/reasoning off. With thinking on, the model writes the tags inside its reasoning block and the final answer comes out empty.

Prompt format

Separate tags with , , use underscores in multi-word tags, prefer tags that exist on Danbooru.

1girl, long_hair, school_uniform, -nude, rating:general
SyntaxMeaning
1girl, blue_hairseed tags to expand
looking_at_viewermulti-word tags use underscores
-nudesemantically avoid this concept and related tags
rating:general / rating:explicitrequested content rating

Training data was mostly NSFW, so the model biases toward explicit content. For SFW output, include rating:general and negatives like -nude, then review the generated tags. These instructions do not guarantee SFW output.

Files

PathContents
model/Merged BF16 Safetensors, tokenizer and chat template (Transformers)
gguf/Qwen3.5-4B-anime.ggufGGUF build, about 2.7 GB
comfyui-prompt-generator/ComfyUI node folder — copy into ComfyUI/custom_nodes/
checksums.jsonSHA-256 hashes of the supplied model files

Text-only model — it does not take images as input. Base: techwithsergiu/Qwen3.5-text-4B-bnb-4bit, derived from Qwen/Qwen3.5-4B.

ComfyUI

  1. Copy comfyui-prompt-generator/ into ComfyUI/custom_nodes/, then install its dependency with ComfyUI's Python and restart:

    python -m pip install -r custom_nodes/comfyui-prompt-generator/requirements.txt
    

    Windows portable, from its root folder:

    .\python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\comfyui-prompt-generator\requirements.txt
    
  2. Load the GGUF (or model/) in LM Studio, enable the local server, and use the supplied chat template with thinking off. The model files do not have to sit inside ComfyUI; the server can run on the same machine or another one reachable over the network.

  3. Set host to the server's API base URL including /v1 (LM Studio default: http://127.0.0.1:1234/v1) and model to the identifier your server exposes.

Required API contract (LM Studio provides it out of the box) — an OpenAI-compatible chat endpoint alone is not enough:

  • POST /v1/chat/completions — OpenAI-compatible chat.
  • GET /api/v1/models — JSON with a models list; entries expose key/display_name and loaded_instances with instance ids.
  • POST /api/v1/models/load — {"model": "<identifier>"}, returns the instance_id used for chat requests.

Node interface

InputDefaultNotes
hosthttp://127.0.0.1:1234/v1API base URL, including /v1
modelqwen3.5-4b-animeModel identifier exposed by the server
tagslong hair, pink hairSeed tags, sent as one user message
prefixscore_9, score_8, score_7, ...Prepended locally, not sent to the model
suffixEmptyAppended locally
temperature1.0Sampling temperature
seed00 omits the seed; positive values are forwarded if supported

Outputs: generated_prompt (generated tags after rating conversion and cleanup) and formatted_prompt (prefix + prompt + suffix joined with , ). Connect formatted_prompt to your positive prompt encoder.

The node maps rating:general → safe and rating:explicit → nsfw, explicit; other tags pass through. It requests at most 1,024 output tokens and drops the final fragment if the server reports a length cutoff. Rating conversion only rewrites output text — it does not filter content.

Transformers inference

python -m pip install "transformers>=5.5.0" accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("./model")
model = AutoModelForCausalLM.from_pretrained(
    "./model", dtype=torch.bfloat16, device_map="auto"
).eval()

messages = [{"role": "user", "content": "1girl, red_hair, -nude, rating:general"}]
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

with torch.inference_mode():
    outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=1.0)

print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip())

This returns the raw response, including any rating: tag; the node's rating conversion and prefix/suffix are separate post-processing. BF16 needs roughly 8.4 GB of weights plus KV cache — use the GGUF build for lower memory.

Troubleshooting

  • Node missing: install requests into the Python env that runs ComfyUI, restart, check the startup log.
  • Connection refused: host must end in /v1; check address, port and network reachability (note 127.0.0.1 is local to where ComfyUI runs).
  • 404 or model-load error: the weight path is not the model identifier; match the server's model-management API.
  • Empty response: disable thinking in the server's chat-template settings. With thinking on, the tags end up inside the reasoning block and the final answer is empty.
  • Slow first request: the node allows up to 300 s for model loading and generation; reduce context or GPU offload on memory errors.

License

Apache-2.0. See the Apache License 2.0 and the upstream Qwen license.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
d54023f

0 моделей