Skip to content

Commit

Permalink
add inpainting model
Browse files Browse the repository at this point in the history
  • Loading branch information
pesser committed Dec 21, 2021
1 parent 17e64e3 commit 32a9661
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,23 @@ We provide a first script for sampling from our unconditional models. Start it v
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>
```

## Coming Soon...

# Inpainting
![inpainting](assets/inpainting.png)

Download the pre-trained weights
```
wget -O models/ldm/inpainting_big/last.ckpt https://heibox.uni-heidelberg.de/f/4d9ac7ea40c64582b7c9/?dl=1
```

and sample with
```
python scripts/inpaint.py --indir data/inpainting_examples/ --outdir outputs/inpainting_results
```
`indir` should contain images `*.png` and masks `<image_fname>_mask.png` like
the examples provided in `data/inpainting_examples`.

## Coming Soon...

* Code for training LDMs and the corresponding compression models.
* Inference scripts for conditional LDMs for various conditioning modalities.
* In the meantime, you can play with our colab notebook https://colab.research.google.com/drive/1xqzUi2iXQXDqXBHQGP9Mqt2YrYW6cx-J?usp=sharing
Expand Down
7 changes: 2 additions & 5 deletions scripts/download_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ wget -O models/ldm/cin256/model.zip https://ommer-lab.com/files/latent-diffusion
wget -O models/ldm/semantic_synthesis512/model.zip https://ommer-lab.com/files/latent-diffusion/semantic_synthesis.zip
wget -O models/ldm/bsr_sr/model.zip https://ommer-lab.com/files/latent-diffusion/sr_bsr.zip
wget -O models/ldm/layout2img-openimages256/model.zip https://ommer-lab.com/files/latent-diffusion/layout2img_model.zip
wget -O models/ldm/inpainting_big/model.zip #TODO @patrick add path
wget -O models/ldm/inpainting_big/last.ckpt https://heibox.uni-heidelberg.de/f/4d9ac7ea40c64582b7c9/?dl=1



Expand Down Expand Up @@ -39,7 +39,4 @@ unzip -o model.zip
cd ../layout2img-openimages256
unzip -o model.zip

cd ../inpainting_big
unzip -o model.zip

cd ../..
cd ../..

0 comments on commit 32a9661

Please sign in to comment.