File size: 1,432 Bytes
1cb89a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Hugging Face Space Setup Guide

## Quick Start

1. **Copy necessary files to this directory:**

```bash
# Copy pipeline file (if QwenImageEditPipeline is not in diffusers yet)
cp ../UniPic/UniPic-3/qwen_image_edit_fast/pipeline_qwenimage_edit.py .
```

2. **Upload to Hugging Face Space:**

```bash
# Install huggingface_hub if needed
pip install huggingface_hub

# Login
huggingface-cli login

# Create a new Space
huggingface-cli repo create your-space-name --type space

# Upload files
cd /path/to/gradio
huggingface-cli upload your-space-name app.py requirements.txt README.md
# If needed, also upload pipeline_qwenimage_edit.py
```

## Files Structure

```
gradio_demo/
β”œβ”€β”€ app.py                    # Main Gradio application (required)
β”œβ”€β”€ requirements.txt          # Python dependencies (required)
β”œβ”€β”€ README.md                 # Space description (required)
└── pipeline_qwenimage_edit.py  # Pipeline code (if not in diffusers)
```

## Environment Variables (Optional)

You can set these in HF Space settings:

- `MODEL_NAME`: Base model name (default: "Qwen-Image-Edit")
- `TRANSFORMER_PATH`: DMD model path (default: "Skywork/Unipic3-DMD/ema_transformer")

## Notes

- The pipeline will try to import from `diffusers` first
- If not available, it will fallback to local `pipeline_qwenimage_edit.py`
- Make sure to copy the pipeline file if QwenImageEditPipeline is not in your diffusers version