Comments (6)
Same question. Did you find it?
from stable-diffusion.
@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.
If you're still looking it's here:
stable-diffusion/ldm/models/diffusion/ddpm.py
Lines 396 to 403 in 57eea7d
from stable-diffusion.
@justinpinkney Thank you so much. I'm clear now. Let me close this issue.
from stable-diffusion.
Interesting. This block does not exist in the official CompVis release...
from stable-diffusion.
@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)
- Missing Parenthesis? HOT 2
- ModuleNotFoundError: No module named 'torchtext.legacy'
- ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' HOT 3
- cannot import name 'autocast' from 'torch' HOT 3
- Dockerfile?
- Broken dependency(?) on a fresh installation HOT 1
- latent diffusion vs stable diffusion HOT 1
- ModuleNotFoundError: No module named 'ldm' HOT 2
- inpaint.sd won't work out of the box. HOT 2
- Repeated inpainting leads to saturated pixels
- Upgrade to Lightning 1.7
- About fine-tuning for inpainting HOT 2
- when I finetune sd model, and set trainer(precision=16), an error occurred
- Not sure why i can't pull SD through the batchweb ui. HOT 1
- Stable Diffusion Master Tutorials List - Including SDXL 0.9 - 43 Tutorials - Not An Issue Thread
- Stable Diffusion latest version reportedly infected with a BeEF Framework attack payload
- meet problems when text2img sampling
- CUDA runs out of memory with lots of memory reserved HOT 11
- AttributeError: partially initialized module 'torch' has no attribute 'Tensor' (most likely due to a circular import) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stable-diffusion.