openai / consistency_models

Official repo for consistency models.
MIT License
6.02k stars 409 forks source link

[inpainting] wrong shape? #48

Open jS5t3r opened 8 months ago

jS5t3r commented 8 months ago

Error: RuntimeError: shape '[-1, 7, 3, 256, 256]' is invalid for input of size 6291456

In https://github.com/openai/consistency_models/blob/e32b69ee436d518377db86fb2127a3972d0d8716/cm/karras_diffusion.py#L806

 mask = th.zeros(*x.shape, device=dist_util.dev())
 mask = mask.reshape(-1, 7, 3, image_size, image_size) <-- why to reshape to 7???!!!!

x.shape is [batch_size, 3, 256, 256] in my code.

Is that a bug? In Algorithm 4 in the paper, they described A as an invertible linear transformation, that maps images to the latent space. I cannot identify any transformation to the latent space.

### Tasks
- [ ] https://github.com/openai/consistency_models/issues/5