Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the difference betwee sample_gs_* and sample_scaled_gs_* #136

Open
Y-ichen opened this issue Feb 14, 2023 · 3 comments
Open

What's the difference betwee sample_gs_* and sample_scaled_gs_* #136

Y-ichen opened this issue Feb 14, 2023 · 3 comments

Comments

@Y-ichen
Copy link

Y-ichen commented Feb 14, 2023

When I was reproducing the results for the paper, I found that files named sample_gs_* and sample_scaled_gs_* are contemporary produced.
The results for sample_scaled_gs_* are good:
samples_scaled_gs-003000_e-000010_b-000000
However I don't know what does a samples_gs_* file means:
samples_gs-003000_e-000010_b-000000
Therefore I want to know the difference between them.
Besides, what makes sample_scaled_gs_* that better than sample_gs_* ? Does the input image set acts as a role for producing sample_scaled_gs_* ? (for example, is the start_code for diffusion model initialized from one image from the given image set?)

@rinongal
Copy link
Owner

rinongal commented Feb 14, 2023

Hi,

You can read more info about the outputs here: #19, #34

tl;dr: The difference is that samples_scaled_gs uses a classifier guidance scale of 5.0, while samples_gs uses a guidance scale of 1.0. You only care about samples_scaled_gs since you're going to use high guidance scales at inference anyhow.

However, If your unscaled samples look too much like your concept, that's a good sign of overfitting.

Also - if you are trying to reproduce - keep in mind the paper predates Stable Diffusion and uses the original LDM. You're not going to get similar results with SD.

@Y-ichen
Copy link
Author

Y-ichen commented Feb 14, 2023

Thanks! That's a good explanation! Actually I am using stable diffusion 1.5 and trying to do some experiments with it, I think SD works well.
If I want to add my own loss, where in the code should I add it? I am not familiar with pytorch_lightning and have difficult to find where the loss is fixed. The loss I want to add is about the generated image with an gt_image given by myself.

@rinongal
Copy link
Owner

You can add losses inside this function:

def p_losses(self, x_start, cond, t, noise=None):

You'll probably have to understand how to pipe your data into that function, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants