Skip to content
Discussion options

You must be logged in to vote

Training a diffusion model from scratch, especially for image inpainting, is absolutely possible, but involves careful setup. Since you're seeing NaN losses after manually modifying a pre-trained model, it’s likely due to input/output mismatches, improper initialization, or numerical instability in training.

Let's go over:


1. Why You're Getting NaN Loss

You said:

“I changed the UNet input channels of 'stable-diffusion-v1-4' to fit for inpainting, and now the loss is NaN.”

That’s a red flag. A few things to verify:

Potential Issues:

  • Input channel mismatch: Did you update all layers that depend on input channels (e.g., first convolution)?
  • Weight init: If you modified layers without rein…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@micklexqg
Comment options

Answer selected by micklexqg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants