/ Модель

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

Контекст
1 024 токена
Лицензия
MIT
Архитектура
florence2 · dense
Опубликована
4 сен 2024

Florence-2-base-PromptGen-v1.5

Генерация текстаТекст → текст3 профессии

Дообученная на базе Florence-2 модель MiaoshouAI создаёт теги и подписи к изображениям для подготовки промптов и работы с Flux.

713скачиваний за 30 дней105лайковвеса обновлены9 окт 2024

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Florence-2-base-PromptGen v1.5 — модель MiaoshouAI для создания подписей к изображениям и тегов, разработанная на основе Florence-2 Base и дообученная для MiaoshouAI Tagger в ComfyUI. Она предназначена для подготовки промптов и тегов к изображениям, в том числе для обучения и генерации изображений. Модель формирует теги в стиле Danbooru, краткие подписи, структурированные описания с расположением объектов, подробные описания и смешанный формат тегов и текста для Flux с T5XXL и CLIP_L. Также заявлено распознавание текста и водяных знаков на изображениях.

Модель принимает изображения и инструкции в текстовом виде и выдаёт текстовые подписи или теги. По данным карточки, она компактна и может работать примерно с немногим более 1 ГБ видеопамяти; для использования предусмотрена интеграция с ComfyUI-Miaoshouai-Tagger. Репозиторий распространяется по лицензии MIT.

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

  • создание тегов в стиле Danbooru для изображений
  • генерация кратких и подробных подписей к изображениям
  • описание расположения объектов на изображении
  • извлечение текста и распознавание водяных знаков на изображении
  • подготовка смешанных подписей и тегов для Flux с T5XXL и CLIP_L

Ограничения

Результаты зависят от выбранной инструкции и могут содержать ошибки в тегах, описании деталей или распознавании текста. Для использования в ComfyUI требуется MiaoshouAI Tagger.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

Florence-2-base-PromptGen v1.5

This is a major version upgrade for PromptGen. In this new version, two new caption instructions are added: <GENERATE_TAGS> and <MIXED_CAPTION> You'll also notice significantly improved accuracy with this version, thanks to a new training dataset. It no longer relies on Civitai Data, avoiding the issues of lora trigger words and inaccurate tags from misinterpretation.

About PromptGen

Florence-2-base-PromptGen is a model trained for MiaoshouAI Tagger for ComfyUI. It is an advanced image captioning tool based on the Microsoft Florence-2 Model Base and fine-tuned to perfection.

Why another tagging model?

Most vision models today are trained mainly for general vision recognition purposes, but when doing prompting and image tagging for model training, the format and details of the captions is quite different. Florence-2-base-PromptGen is trained on such a purpose as aiming to improve the tagging experience and accuracy of the prompt and tagging job. The model is trained based on images and cleaned tags from Civitai so that the end result for tagging the images are the prompts you use to generate these images. You won't get annoying captions like "This is image is about a girl..." or

Features:

  • Describes image in much detail when using <MORE_DETAILED_CAPTION> instruction.
  • When using <DETAILED_CAPTION> instruction, it creates a structured caption with infomation on subject's position and also reads the text from the image, which can be super useful when recreate a scene.
  • Memory efficient compare to other models! This is a really light weight caption model that allows you to use a little more than 1G of VRAM and produce lightening fast and high quality image captions.
  • Designed to handle image captions for Flux model for both T5XXL CLIP and CLIP_L, the Miaoshou Tagger new node called "Flux CLIP Text Encode" which eliminates the need to run two separate tagger tools for caption creation. You can easily populate both CLIPs in a single generation, significantly boosting speed when working with Flux models.

Instruction prompt:

<GENERATE_TAGS> generate prompt as danbooru style tags <CAPTION> a one line caption for the image <DETAILED_CAPTION> a structured caption format which detects the position of the subjects in the image <MORE_DETAILED_CAPTION> a very detailed description for the image <MIXED_CAPTION> a mixed caption style of more detailed caption and tags, this is extremely useful for FLUX model when using T5XXL and CLIP_L together. A new node in MiaoshouTagger ComfyUI is added to support this instruction.

Version History:

For version 1.5, you will notice the following

  1. <GENERATE_PROMPT> is deprecated and replace by <GENERATE_TAGS>
  2. A new instruction for <MIXED_CAPTION>
  3. A much improve accuracy for <DETAILED_CAPTION> and <MORE_DETAILED_CAPTION>
  4. Improved ability for recognizing watermarks on images.

How to use:

To use this model, you can load it directly from the Hugging Face Model Hub:


model = AutoModelForCausalLM.from_pretrained("MiaoshouAI/Florence-2-base-PromptGen-v1.5", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("MiaoshouAI/Florence-2-base-PromptGen-v1.5", trust_remote_code=True)

prompt = "<MORE_DETAILED_CAPTION>"

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(text=prompt, images=image, return_tensors="pt").to(device)

generated_ids = model.generate(
    input_ids=inputs["input_ids"],
    pixel_values=inputs["pixel_values"],
    max_new_tokens=1024,
    do_sample=False,
    num_beams=3
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

parsed_answer = processor.post_process_generation(generated_text, task=prompt, image_size=(image.width, image.height))

print(parsed_answer)

Use under MiaoshouAI Tagger ComfyUI

If you just want to use this model, you can use it under ComfyUI-Miaoshouai-Tagger

https://github.com/miaoshouai/ComfyUI-Miaoshouai-Tagger

A detailed use and install instruction is already there. (If you have already installed MiaoshouAI Tagger, you need to update the node in ComfyUI Manager first or use git pull to get the latest update.)

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
Florence2ForConditionalGeneration
Ревизия весов
caf550c

0 моделей