Skip to content

Commit

Permalink
[hotfix] fix stable diffusion inference bug. (hpcaitech#5289)
Browse files Browse the repository at this point in the history
* Update train_ddp.yaml

delete  "strategy" to fix DDP config loading bug in "main.py"

* Update train_ddp.yaml

fix inference with scripts/txt2img.py config file load bug.

* Update README.md

add pretrain model test code.
  • Loading branch information
Youngon authored and flybird11111 committed Mar 18, 2024
1 parent 3e71ac4 commit 47fd780
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/images/diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ python main.py --logdir /tmp/ -t -b configs/Teyvat/train_colossalai_teyvat.yaml
```

## Inference
if you want to test with pretrain model,as bellow:
python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms --outdir ./output --ckpt 512-base-ema.ckpt --config configs/train_ddp.yaml

You can get your training last.ckpt and train config.yaml in your `--logdir`, and run by
```
Expand Down
3 changes: 1 addition & 2 deletions examples/images/diffusion/configs/train_ddp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
model:
base_learning_rate: 1.0e-4
target: ldm.models.diffusion.ddpm.LatentDiffusion
params:
parameterization: "v"
linear_start: 0.00085
Expand Down Expand Up @@ -86,8 +87,6 @@ lightning:
max_epochs: 2
precision: 16
auto_select_gpus: False
strategy:
find_unused_parameters: False
log_every_n_steps: 2
# max_steps: 6o
logger: True
Expand Down

0 comments on commit 47fd780

Please sign in to comment.