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

Loss Changes #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Loss Changes #2

wants to merge 2 commits into from

Conversation

Philipuss1
Copy link

Added two new loss functions and also made a few small changes

Added two new loss functions and also made a few small changes
@illtellyoulater
Copy link

@Philipuss1 hi, may I ask what those two functions do and how they would improve the generation? Ty!

@Philipuss1
Copy link
Author

@illtellyoulater Well, you can experiment with them in the latest version of Majesty Diffusion afaik, but in general, mean loss makes the picture more white and kind of make it look like a sketch, while the var loss is the same as mean loss, but black instead of white. It won't improve your image generation, but if you seek a specific effect on the image, these two loss functions can help

@illtellyoulater
Copy link

Thanks! But how do I call those functions? Should I include something in the diffusion schedule?

@Philipuss1
Copy link
Author

@illtellyoulater You can just change the mean_scale and var_scale variables

@Dango233
Copy link
Collaborator

Dango233 commented Jul 2, 2022

Added two new loss functions and also made a few small changes

Thank you for making this PR! I did a slightly different implementation - so now this loss works directly on latent space., and having a threholding parameter to it.

var_index, var_range = ([0]*1000,0.5)
mean_index, mean_range = ([0]*400+[0]*1000, 0.75)

var_index is the var_scale on different timesteps, var_range defines when the var_loss kick in - only when var > var_range, the var_loss will kick in.

@Dango233 Dango233 added the enhancement New feature or request label Jul 2, 2022
@Philipuss1
Copy link
Author

@Dango233 Ooh this is great! Much better than what I did!
Also, should I close the PR? I feel like it's pointless keeping it open anymore 🤔

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

Successfully merging this pull request may close these issues.

3 participants