Code Monkey home page Code Monkey logo

Comments (6)

XavierXiao avatar XavierXiao commented on July 18, 2024

Same question. Did you find it?

from stable-diffusion.

fugokidi avatar fugokidi commented on July 18, 2024

@XavierXiao I didn't find it. Probably it is not the latest code for the released stable diffusion. Anyway, we can do it on our own. If you want to do text drop out, one way may be, we can filter it in get_input method in ddpm.py. Text conditions are a list of captions, for example a batch size of 3, ['capiton one', 'caption two', 'caption three']. I think it is easier to do it in numpy.

captions = ['caption one', 'caption two', 'caption three']
null_labels = [""] * len(captions)
prob = torch.rand((len(captions),))
filtered_captions = np.where(prob > 0.1, captions, null_labels).tolist()

I'm a newbie in diffusion. Sorry, I am not very friendly with the whole codebase. I might miss something.

from stable-diffusion.

justinpinkney avatar justinpinkney commented on July 18, 2024

If you're still looking it's here:

for k in self.ucg_training:
p = self.ucg_training[k]["p"]
val = self.ucg_training[k]["val"]
if val is None:
val = ""
for i in range(len(batch[k])):
if self.ucg_prng.choice(2, p=[1-p, p]):
batch[k][i] = val

from stable-diffusion.

fugokidi avatar fugokidi commented on July 18, 2024

@justinpinkney Thank you so much. I'm clear now. Let me close this issue.

from stable-diffusion.

XavierXiao avatar XavierXiao commented on July 18, 2024

Interesting. This block does not exist in the official CompVis release...

from stable-diffusion.

fugokidi avatar fugokidi commented on July 18, 2024

@XavierXiao I think official CompVis release is mainly for inference. Pesser is really kind to share development repo here. Justin (@justinpinkney ) also share training details of image variation fork (https://github.com/justinpinkney/stable-diffusion), he shares all the training details. I am really grateful to both of them. I cannot understand things if I don't try. I can play around with this repo and makes me more understood about how stable diffusion works.

from stable-diffusion.

Related Issues (20)

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.