#
## Model Introduction
This model is trained using the [Civision/model training](https://modelscope.ai/civision/modelTraining) environment and computing resources provided by ModelScope.
* Model Type: LoRA
* Base Model: [Qwen/Qwen-Image-Edit-2509](https://modelscope.ai/models/Qwen/Qwen-Image-Edit-2509)
* Training Code: [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)
* Data amount:4
* Total training steps:4000
* License: Apache-2.0
## Inference Code
Install [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio):
```bash
pip install diffsynth
```
Inference:
```python
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
from PIL import Image
import torch
pipe = QwenImagePipeline.from_pretrained(
torch_dtype=torch.bfloat16,
device="cuda",
model_configs=[
ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509", origin_file_pattern="transformer/diffusion_pytorch_model*.safetensors"),
ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="text_encoder/model*.safetensors"),
ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
],
processor_config=ModelConfig(model_id="Qwen/Qwen-Image-Edit", origin_file_pattern="processor/"),
)
pipe.load_lora(pipe.dit, ModelConfig(model_id="AyanAli6780/Sammy", origin_file_pattern="Sammy_c1-st4000.safetensors"))
prompt = "Convert the image style to anime style."
edit_image = Image.open("your_image.jpg")
image = pipe(prompt, edit_image=[edit_image], edit_image_auto_resize=True)
image.save("image.jpg")
```
