Skip to content

Commit 32a9661

Browse files
committed
add inpainting model
1 parent 17e64e3 commit 32a9661

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,23 @@ We provide a first script for sampling from our unconditional models. Start it v
7070
CUDA_VISIBLE_DEVICES=<GPU_ID> python scripts/sample_diffusion.py -r models/ldm/<model_spec>/model.ckpt -l <logdir> -n <\#samples> --batch_size <batch_size> -c <\#ddim steps> -e <\#eta>
7171
```
7272

73-
## Coming Soon...
74-
73+
# Inpainting
7574
![inpainting](assets/inpainting.png)
7675

76+
Download the pre-trained weights
77+
```
78+
wget -O models/ldm/inpainting_big/last.ckpt https://heibox.uni-heidelberg.de/f/4d9ac7ea40c64582b7c9/?dl=1
79+
```
80+
81+
and sample with
82+
```
83+
python scripts/inpaint.py --indir data/inpainting_examples/ --outdir outputs/inpainting_results
84+
```
85+
`indir` should contain images `*.png` and masks `<image_fname>_mask.png` like
86+
the examples provided in `data/inpainting_examples`.
87+
88+
## Coming Soon...
89+
7790
* Code for training LDMs and the corresponding compression models.
7891
* Inference scripts for conditional LDMs for various conditioning modalities.
7992
* In the meantime, you can play with our colab notebook https://colab.research.google.com/drive/1xqzUi2iXQXDqXBHQGP9Mqt2YrYW6cx-J?usp=sharing

scripts/download_models.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ wget -O models/ldm/cin256/model.zip https://ommer-lab.com/files/latent-diffusion
88
wget -O models/ldm/semantic_synthesis512/model.zip https://ommer-lab.com/files/latent-diffusion/semantic_synthesis.zip
99
wget -O models/ldm/bsr_sr/model.zip https://ommer-lab.com/files/latent-diffusion/sr_bsr.zip
1010
wget -O models/ldm/layout2img-openimages256/model.zip https://ommer-lab.com/files/latent-diffusion/layout2img_model.zip
11-
wget -O models/ldm/inpainting_big/model.zip #TODO @patrick add path
11+
wget -O models/ldm/inpainting_big/last.ckpt https://heibox.uni-heidelberg.de/f/4d9ac7ea40c64582b7c9/?dl=1
1212

1313

1414

@@ -39,7 +39,4 @@ unzip -o model.zip
3939
cd ../layout2img-openimages256
4040
unzip -o model.zip
4141

42-
cd ../inpainting_big
43-
unzip -o model.zip
44-
45-
cd ../..
42+
cd ../..

0 commit comments

Comments
 (0)