CoolFace
Modelpublic

KBlueLeaf/TIPO-500M-ft

sourceHugging Faceotherupdated 2y agoView on Hugging Face
48likes57kdownloads
Model Card

TIPO: Text to Image with text presampling for Prompt Optimization

500M LLaMA arch model trained for TIPO. <br> Tech Report: https://arxiv.org/abs/2411.08127

image/png

Introduction

In this project, we introduce "TIPO" (Text to Image with text presampling for Prompt Optimization), an innovative framework designed to significantly enhance the quality and usability of Text-to-Image (T2I) generative models. TIPO utilizes the Large Language Models (LLMs) to perform "Text Presampling" within the inference pipeline of text-to-image generative modeling. By refining and extending user input prompts, TIPO enables generative models to produce superior results with minimal user effort, making T2I systems more accessible and effective for a wider range of users.

Usage

Use updated version of DTG extension (renamed to z-tipo-extension), current version of z-tipo-extension support stable-diffusion-webui, stable-diffusion-webui-forge and ComfyUI. SD-Next haven't been tested. https://github.com/KohakuBlueleaf/z-tipo-extension

Model arch and Training

This model is LLaMA arch with 200M parameters, the training data is combined version of Danbooru2023, Coyo-HD-11M. <br> The total token seen is around 50B tokens. <br> For more information please refer to the tech report and following table.

TIPO-200MTIPO-500M-ftTIPO-500M
ArchLLaMALLaMALLaMA
Max ctx length102410241024
Batch Size204835843584
Training datasetDanbooru, GBC10M, 5epoch<br />Danbooru, GBC10M, Coyo11M, 3epochDanbooru(pixtral), GBC10M, Coyo11M, 2epochDanbooru, GBC10M, Coyo11M, 5epoch
Real Token Seen*40B token42B (12B more from TIPO-500M)30B token
Training HardwareRTX 3090 x 4RTX 3090 x 4H100 x 8
Training Time420 hour`290 hour`100 hour`
HuggingfaceKBlueLeaf/TIPO-200M · Hugging FaceYou Are HEREKBlueLeaf/TIPO-500M · Hugging Face

*: We only count "non-padding token" in the token seen, since all the training data have very large length range. <br> `: Since the training data is pretty short, it cost more time to reach same token seen than general LLM pretraining. <br> As reference, with 4096 as max ctx length and almost all the data have reach that length, you may only need 2days to reach 10B token seen on RTX 3090 x 4 with 200M model.

Evaluation

Evaluation are done on TIPO-200M model <br> We have tested TIPO compared to other Model in several test and metrics:

Scenery tag test

In this test we use single "scenery" tag as input. (With some certain meta) <br> To test each prompt gen method to see if they can obtain the desired distribution of outputs while maintain the quality of images.

Scenery Tag TestOriginalGPT4o-miniPrompt DBPromptisTIPO(ours)
FDD ↓0.35580.54140.32470.23500.2282
Aesthetic ↑5.05696.36766.16095.94686.2571
AI Corrupt ↑0.42570.74900.50240.56690.9195
Short/Truncated Long test

In this test we use short caption or manually truncated caption from GBC10M and CoyoHD11M. <br> This test examine the ability of prompt gen method on handling almostly completed prompts.

ShortOriginalGPT4o-miniPrompt DBPromptisTIPO(ours)
FDD ↓0.09570.16680.09800.17830.1168
Aesthetic ↑5.83706.05895.82135.79635.8531
AI Corrupt ↑0.71130.69850.70640.63140.7131
Truncated LongOriginalGPT4o-miniPrompt DBPromptisTIPO(ours)
FDD ↓0.09550.16830.12470.20960.1210
Aesthetic ↑5.74976.01685.81915.77595.8364
AI Corrupt ↑0.68680.67120.67410.59250.7130

LICENSE

This model is released under Kohaku License 1.0 <br> You can check the above provided URL or check the LICENSE file in this repo.

Citation

bibtex
@misc{yeh2024tipotextimagetext,
      title={TIPO: Text to Image with Text Presampling for Prompt Optimization}, 
      author={Shih-Ying Yeh and Sang-Hyun Park and Giyeong Oh and Min Song and Youngjae Yu},
      year={2024},
      eprint={2411.08127},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2411.08127}, 
}