Run this model with HF Jobs

Run PromptEnhancer/PromptEnhancer-Img2img-Edit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/PromptEnhancer/PromptEnhancer-Img2img-Edit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/PromptEnhancer/PromptEnhancer-Img2img-Edit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/PromptEnhancer/PromptEnhancer-Img2img-Edit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/PromptEnhancer/PromptEnhancer-Img2img-Edit. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

PromptEnhancerV2 (32B) - Img2Img Edit

PromptEnhancerV2 is a multimodal language model fine-tuned for image-to-image editing instruction enhancement and rewriting. It refines editing instructions by leveraging both the input text and the provided image, preserving the original intent while producing clearer, structured, and logically consistent prompts suitable for downstream image editing tasks.

Model Details

Model Description

PromptEnhancerV2 (Img2Img Edit) is a specialized vision-language prompt rewriting model that employs chain-of-thought reasoning to enhance user editing instructions with visual context.

  • Model type: Vision-Language Model for Prompt Enhancement
  • Language(s) (NLP): Chinese (zh), English (en)
  • License: Apache-2.0
  • Finetuned from model: Qwen/Qwen2.5-VL-32B-Instruct

Model Sources

How to Get Started with the Model

  • 1. Clone the repository::
git clone https://github.com/ximinng/PromptEnhancer.git
cd PromptEnhancer
pip install -r requirements.txt
  • 2. Model Download:
huggingface-cli download PromptEnhancer/PromptEnhancer-Img2img-Edit --local-dir ./models/promptenhancer-img2img-edit
  • 3. Use the model:
from inference.prompt_enhancer_img2img import PromptEnhancerImg2Img

# Initialize the model
models_root_path = "./models/promptenhancer-img2img-edit"
enhancer = PromptEnhancerImg2Img(model_path=models_root_path, device_map="auto")

# Enhance an editing instruction with image context (Chinese or English)
edit_instruction = "去掉图片底部的水印,保留主体不变"
image_path = "./examples/sample_image.png"

enhanced_prompt = enhancer.predict(
    edit_instruction=edit_instruction,
    image_path=image_path,
    temperature=0.1,
    top_p=0.9,
    max_new_tokens=2048
)

print("Enhanced:", enhanced_prompt)

Citation

If you find this model useful, please consider citing:

BibTeX:

@article{promptenhancer,
  title={PromptEnhancer: A Simple Approach to Enhance Text-to-Image Models via Chain-of-Thought Prompt Rewriting},
  author={Wang, Linqing and Xing, Ximing and Cheng, Yiji and Zhao, Zhiyuan and Donghao, Li and Tiankai, Hang and Zhenxi, Li and Tao, Jiale and Wang, QiXun and Li, Ruihuang and Chen, Comi and Li, Xin and Wu, Mingrui and Deng, Xinchi and Gu, Shuyang and Wang, Chunyu and Lu, Qinglin},
  journal={arXiv preprint arXiv:2509.04545},
  year={2025}
}
Downloads last month
42
Safetensors
Model size
33B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for PromptEnhancer/PromptEnhancer-Img2img-Edit

Finetuned
(73)
this model
Quantizations
2 models

Space using PromptEnhancer/PromptEnhancer-Img2img-Edit 1

Paper for PromptEnhancer/PromptEnhancer-Img2img-Edit