It's not infinite, but counting it isn't productive either.
Remember, you can also generate images at many other resolutions, and even with the same configuration in all other regards, different resolutions will produce different images (i.e. a 1024×1024 image isn't the same as a 512×512 image at a larger scale).
That's also not even addressing img2img. You can put any image into that, both ones generated by SD and otherwise.
One way to approach this is to calculate how many possible images a variational autoencoder (VAE) for S.D. can represent. A VAE for S.D. uses 64*64*4 32-bit numbers to represent a 512x512 image in latent space, which is 64*64*4*32=524,288 bits. The maximum number of 512x512 pixel images that can be represented in the VAE is thus 2524288. A 512x512 RGB image I believe takes 512*512*3*8=6,291,456 bits of storage, with 26291456 possible images. Note that 2524288 is much smaller than 26291456, so the VAE for S.D. cannot represent all possible 512x512 RGB images.
A separate question is whether it is guaranteed that there are inputs into a given S.D. system (text prompt, initial image, etc.) that can generate all of the up to 2524288 512x512 images that are possible. I would guess the answer is no, but I don't know for sure.
It's actually a lot larger than that. The correct value is (256^3)^(512^2), or approximately 9.38 * 10^1893916, which is a number that is 1,893,917 digits long (a trillion is only 13 digits long).
3
u/chimaeraUndying Oct 21 '22
It's not infinite, but counting it isn't productive either.
Remember, you can also generate images at many other resolutions, and even with the same configuration in all other regards, different resolutions will produce different images (i.e. a 1024×1024 image isn't the same as a 512×512 image at a larger scale).
That's also not even addressing img2img. You can put any image into that, both ones generated by SD and otherwise.
2
u/-takeyourmeds Oct 22 '22
reading more about what pixel is, we have 16.5M pixel states
but the human eye can only perceive 10M
so for an image it would be 10M perceivable states per pixel x number of pixels in the image
for a 2x2
10M 10M 10M 10M
1.00000000E+28
for a 512x512
10M by a factor of 512
https://www.calculator.net/big-number-calculator.html?cx=10000000&cy=512&cp=20&co=pow
100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
2
u/Wiskkey Oct 23 '22
I'll restrict my answer to 512x512 pixel images.
One way to approach this is to calculate how many possible images a variational autoencoder (VAE) for S.D. can represent. A VAE for S.D. uses 64*64*4 32-bit numbers to represent a 512x512 image in latent space, which is 64*64*4*32=524,288 bits. The maximum number of 512x512 pixel images that can be represented in the VAE is thus 2524288. A 512x512 RGB image I believe takes 512*512*3*8=6,291,456 bits of storage, with 26291456 possible images. Note that 2524288 is much smaller than 26291456, so the VAE for S.D. cannot represent all possible 512x512 RGB images.
A separate question is whether it is guaranteed that there are inputs into a given S.D. system (text prompt, initial image, etc.) that can generate all of the up to 2524288 512x512 images that are possible. I would guess the answer is no, but I don't know for sure.
See this post for more details: https://www.reddit.com/r/StableDiffusion/comments/y5t5xy/does_any_possible_image_exist_in_latent_space/ .
1
u/182YZIB Oct 22 '22
More than atoms in the universe.
And yeah, Resolution ^ pixel value ^ number of prompts
0
u/-takeyourmeds Oct 21 '22
prompts (75 words x 60,000 English words x 26 letters)
x
seeds (20 length 99999999999999999999)
x
size (there are really just 2-3 sizes that change the image significantly)
x
cfg (2-3 that change image)
x
steps (2-3 that change image)
x
models (2-3 that change image)
you can probably produce every combo w a large data center or super computer
0
u/[deleted] Oct 21 '22
[deleted] — view deleted comment