File size: 1,739 Bytes
1c7bbea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
Model from: https://huggingface.co/JunhaoZhuang/PowerPaint_v2

Tokens (P_ctxt, P_shape, P_obj) added by PowerPaint has been integrated into the text_encoder and tokenizer.

Unlike PowerPaint_v1, PowerPaint_v2 uses a method similar to BrushNet, so it can be applied to any sd1.5 type basic model.

Clone demo code and models:

```bash
git lfs install
git clone https://huggingface.co/Sanster/PowerPaint_v2
```

Run `main.py`:

```bash
python3 main.py runwayml/stable-diffusion-v1-5
```

The demo code will generate following results:

| Original Image                                                                                                                                 | Mask                                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| ![original_image](https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png) | ![mask_image](https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png) |

**Object Removal Task**

![object-removal](./object-removal_result.png)

**Shape Guided Task**

![shape-guided](./shape-guided_result.png)

**Context aware Task**

![context-aware](./context-aware_result.png)

**Inpaint Task**

![inpaint](./inpaint_result.png)

**Outpaint Task**

![outpaint](./image-outpainting_result.png)