Giter Site home page Giter Site logo

explainingai-code / stablediffusion-pytorch Goto Github PK

View Code? Open in Web Editor NEW
66.0 3.0 13.0 91 KB

This repo implements a Stable Diffusion model in PyTorch with all the essential components.

Python 100.00%
latent-diffusion latent-diffusion-models stable-diffusion stable-diffusion-tutorial

stablediffusion-pytorch's Issues

It wuold be greatly appreciated if model ckpts could be provided

Hello @explainingai-code !
I have read your code carefully and can train unconditional and text-conditioned celebHQ model now, but my GPU is only one V100 card and it's expected to train for ~110 hours to get one result, which is very time consuming. Renting a GPU cluster is also very expensive and time-consuming. If you have already trained the model, could you provide download links for model ckpts for convenience? I think this would be very helpful for people to quickly use your codebase.
Moreover, thank you again for your great codebase and I think it wuold be greatly appreciated if model ckpts could be provided.

Sincerely,
CatLoves

Question about sampling data

Hello,
First of all thanks again for sharing the code and good work on that!

I have one doubt about sampling data (after training fase).

When "t" is not equal to zero you are using x0 into "im" variable (instead using mean + sigma * z) but when t is equal to zero you are using the mean variable. Why?

I guess you should use always mean + sigma * z every time when t is not equal to zero right?

How to condition based on multiple features?

I would like to condition the model using multiple features. In my case, I have lot of columns say A, B, C and D and some of the columns are categorical and some are numerical. Now I wanted to implement stable diffusion by conditioning on all the columns together. Please advise what are the modifications I need to do.

Thanks.

Bug when saving Latent information?

Hello,
When you run infer_vqvae.py you save the latent information (encoded information) but you do not clamp it (torch.clamp(encoded_output, -1., 1.)).

I also checked when you read it from dataset and when the variable of use_latents is equal to True you don't clamp it.

Maybe its a bug?

Thank you!

Unable to run

Hello there, I am trying to run conditional text part and have followed all the instructions but at the end I am facing following error. Screenshot attached below. It says "Model checkpoint celebhq/ddpm_ckpt_text_cond_clip.pth not found"
Screenshot 2024-03-28 144732

The training loss is not decreasing

Hi,
Thank you for your code.

I am training a ldm model with the config file I have attached.
I have training with multiple dataset and settings. Always the training loss doesnt converge after certain epochs. usually it is when the loss is somewhere around 0.1. The loss does goes down consistently but very slowly.
As I am using MSE loss 0.1 is large for image generation.

Once I continued training until 400 epochs at that time the model was overfitted but the loss was minimum around 0.02.
May be could you share your insights or does anyone has faced this issue?
tuned_class_cond_bdd_1.zip

Running out of memory... best number of samples for custom data sets?

Hello!

I was wondering if you have any intuition on how many training samples are required to get good results/how much memory is required to train the unconditional VQVAE?

I have about 200k grayscale images at 256x256... which was obviously too much, so I scaled back to 70 images just to see if it would start training, but it didn't... throwing the too little memory error.

Is this something batch size can fix or do I need to mess with a bunch of other parameters? I only changed the im_channels and save_latent parameters from their defaults.

Thank you!

Losses for conditional diffusion models

Hey thanks for the videos and codes, I am experimenting with conditional ldms.

Do you happen to have loss plots or logs of the loss? I have a feeling that the loss is decreasing really slowly or not decreasing at all.
Could you let me know if you had similar loss decrease? Here is the screenshot for your reference.

Screenshot 2024-05-20 at 13 54 27

ldm for inpainting

Many thanks for your amazing work.

Im wondering for the cases of the inpainting do you pass the image and masked image through the same pretrained VAE. and what is the training data of this VAE is it on the images or the dataset contain also the masked images?? or you train separate VAEs for each one ?

Unexpected output after sampling using Conditional LDM

I am getting a bunch of noodle-like waves after sampling for conditional LDM instead of proper digits. The unconditional LDM works fine. I am using the MNIST dataset that the Torchvision library has (torchvision.datasets.MNIST).

Can you tell what could be wrong in this scenario?

I have attached x0_0.png outputs for both Unconditional_LDM and Conditional_LDM.
Unconditional_LDM_x0_0
Conditional_LDM_x0_0

Why your model generated mnist images are noises?

Dear explainingai-code:
Your codebase for ddpm is so detailed and helpful that I would like to thank you very much for your great work !
I have downloaded this codebase and follow your instructions carefully, luckly I got a good VQVAE result as follows:
image

So I continue to train unconditional and class conditional ddpm models. 
I run python tools/train_ddpm_vqvae.py to train unconditional ddpm model and it seems to have converged as follows:

image
The loss decreases from 0.2833 to 0.0886. Then I run python tools/sample_ddpm_vqvae.py to check model output, I get mnist/samples/x0_0.png to x0_999.png, all seems like PURE NOISE as follows:
image

 Simiarly I trained and tested mnist class conditional ddpm and all results seems like PURE NOISE as follows:

image

 My code structure as follows:

image
I am sure that I just follow your instructions and DO NOT modify model related code, but the results seems weired. Appreciated if you could give some help.

Sincere,
CatLoves

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.