Downloads · 30 days
28
2% of all-time downloads
imranali291/flux-prompt-enhancer
flux-prompt-enhancer is a machine learning model from imranali291. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
The model has been finetuned to optimize the conversion of short prompts into detailed prompts, enabling stable diffusion or flux-based image generation. This refinement enables users to craft more specific and nuance…
Downloads · 30 days
28
2% of all-time downloads
All-time downloads
1.4K
Public
Parameters
60.5M
243 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors242 MB · 100%
From the Hugging Face model README
The model has been finetuned to optimize the conversion of short prompts into detailed prompts, enabling stable diffusion or flux-based image generation. This refinement enables users to craft more specific and nuanced requests, resulting in higher-quality and more coherent images.
Use the code below to get started with the model.
from transformers import T5Tokenizer, T5ForConditionalGeneration
# Load the tokenizer and model
tokenizer = T5Tokenizer.from_pretrained("imranali291/flux-prompt-enhancer")
model = T5ForConditionalGeneration.from_pretrained("imranali291/flux-prompt-enhancer")
# Example input
input_text = "Futuristic cityscape at twilight descent."
# Tokenize input
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
# Generate output
output = model.generate(input_ids, max_length=128, eos_token_id=tokenizer.eos_token_id, do_sample=True, top_p=0.9, temperature=0.7, repetition_penalty=2.5)
print(tokenizer.decode(output[0], skip_special_tokens=True))