Instructions to use Matteoooo46/ReCoEdit-rewriter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Matteoooo46/ReCoEdit-rewriter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/data/phd/kousiqi/zhitao/models/Qwen3-VL-8B-Instruct") model = PeftModel.from_pretrained(base_model, "Matteoooo46/ReCoEdit-rewriter") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen3-VL-8B-Instruct
|
| 3 |
+
library_name: peft
|
| 4 |
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- vision-language
|
| 8 |
+
- prompt-rewriting
|
| 9 |
+
- image-editing
|
| 10 |
+
- ecommerce
|
| 11 |
---
|
| 12 |
+
|
| 13 |
+
# ReCoEdit — Prompt Rewriter LoRA
|
| 14 |
+
|
| 15 |
+
LoRA adapter for **Qwen3-VL-8B-Instruct**, trained to rewrite raw e-commerce product prompts into structured editing instructions for Qwen-Image-Edit.
|
| 16 |
+
|
| 17 |
+
- **Base model**: `Qwen/Qwen3-VL-8B-Instruct`
|
| 18 |
+
- **Training**: SFT via LLaMA-Factory on paired (product image, raw prompt → structured prompt) data
|
| 19 |
+
- **Input**: Product reference image + raw editing prompt (Chinese)
|
| 20 |
+
- **Output**: Structured editing prompt optimized for Qwen-Image-Edit (120-150 chars, Chinese)
|
| 21 |
+
- **LoRA rank**: 64, trained for 10,000 steps
|
| 22 |
+
|
| 23 |
+
## Usage
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
from transformers import AutoProcessor
|
| 27 |
+
from qwen_vl_utils import process_vision_info
|
| 28 |
+
from peft import PeftModel
|
| 29 |
+
from transformers import Qwen3VLForConditionalGeneration
|
| 30 |
+
from huggingface_hub import snapshot_download
|
| 31 |
+
|
| 32 |
+
base_model = "Qwen/Qwen3-VL-8B-Instruct"
|
| 33 |
+
lora_path = snapshot_download("Matteoooo46/ReCoEdit-rewriter")
|
| 34 |
+
|
| 35 |
+
model = Qwen3VLForConditionalGeneration.from_pretrained(
|
| 36 |
+
base_model, torch_dtype="auto", device_map="auto"
|
| 37 |
+
)
|
| 38 |
+
model = PeftModel.from_pretrained(model, lora_path)
|
| 39 |
+
processor = AutoProcessor.from_pretrained(base_model, trust_remote_code=True)
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
See the [ReCoEdit repository](https://github.com/Matteoooo46/ReCoEdit) for the complete inference pipeline.
|
| 43 |
+
|
| 44 |
+
## Citation
|
| 45 |
+
|
| 46 |
+
```bibtex
|
| 47 |
+
@misc{recoedit2025,
|
| 48 |
+
title={ReCoEdit: Rewriter-Guided Consistency Alignment for Product Image Editing},
|
| 49 |
+
author={},
|
| 50 |
+
year={2025},
|
| 51 |
+
howpublished={\url{https://github.com/Matteoooo46/ReCoEdit}},
|
| 52 |
+
}
|
| 53 |
+
```
|