Nicholas Guttenberg (@ngutten) profile picture

Physicist/ML researcher creating artificial universes. @nichg@sigmoid.social

Joined November 2012
Experiments with #stablediffusion... Its very hard to get it to generate images with average value outside of the 0.4..0.6 range, even if you fine-tune on a solid black image. Turns out its a property of the noise distribution. i.i.d 512x512 Gaussian has very close to zero mean.
1
7
815
Interesting dynamics of inference... Imagine a coin flip process, except you entertain hypotheses that after 1,2,3,...,K flips the sequence will repeat. This is the distribution of predictions that the next flip will be tails as you observe more and more for K=1000
1
1
8
Wonder if this is a generic phenomenon, a 'belief catastrophe' that happens whenever you gradually eliminate a cluster of structurally related hypotheses that make different predictions. The predictions can become correlated faster than the remaining belief in the cluster drops.
1
Is there such a thing as an 'addictive experiment' in science: an experiment which no matter how many times it has been repeated, never seems unimportant to repeat again? (e.g. remains asymptotically interesting in the limit of infinite observations)
4
1
6
From a Bayes/information theory point of view, are there situations such that the expected KL divergence between belief distributions over parameters at observation N and N+1 never asymptotically approaches zero? Do all mis-specified models have that property?
2
Messing with the LMS scheduler in Stable Diffusion. One trick I've found is to use scheduler.add_noise to do partial re-diffusions, e.g. starting halfway through given a starter image. So I can basically let it drift an image by iteratively rediffusing.
1
9
If you re-use the same noise every time, you have to downscale the latents. Even then, the image tends to get more and more stark.
1
2
Any reason why Stable Diffusion style autoencoder + diffusion on latents couldn't be used for very long self-consistent text generation - like 30k tokens+? Have people already done this?
9
With content that is less naturally symmetric, the transition is even more severe...
1
When SD decides 'these repeated noise patches indicate real structure', its a really sharp phase transition (as one might expect given that its a discrete symmetry). Wonder if there are 2nd order phase transitions in the diffusion model as well?
3
Stable Diffusion is extremely sensitive to things like repetition of patterns in the latents. I wonder if its because detecting some sort of regularity is a strong clue as to how to do the noise removal? This image has 5 patches of size 12x12 with repeated noise patterns.
2
5
It does depend on the content though. Maybe not so sensitive for organic prompts? Right image has a 4x4 grid of repeated 8x8 patches
1
1
It might be useful to train a diffusion model where the noise field that it's inverting is not uniform across the image. That way you could have a model where you could 'noise out' bits of the scene in order to specifically reconstruct those.
3
7
Messing with prompt weighting via duplication. 5 copies of the style prompt, 1 copy of the 'library' prompt, 1 copy of the 'cat and wizard' prompt. The cat is a strong attractor. I don't know why it has a ... whatever that thing is?
1
3
3 style, 1 library, 1 catwizard. Concerning...
1
1
It does tend to munge together elements when the prompts get long (the full prompts do not fit in this tweet, but basically its supposed to be a blue orb, an infinite library, a wizard at a desk, and a persian shorthair cat by his side).
1
1
Left is first sentence only. Top right is first two sentences. Bottom right is all three sentences. Same latent.
1
Concatenating prompts (left) versus concatenating the sequence of embeddings (right) in Stable Diffusion. There's a 75 token limit because of CLIP, but if you can concatenate prompts you can basically have as many tokens as memory allows as long as each sentence is 75 tokens.
1
1
4
The prompts were "A beautiful, intricate, highly realistic painting of a spaceship in flight by Faustus Fauxnomen. High resolution desktop background, digital art." and "Watercolor bristling gleaming impressionist delights, a painting of a desert city by a sparkling blue ocean."
2
Funny thing, adding 'pixel artwork' to an SD prompt (right images) doesn't necessarily make the output pixelized, but it does seem to make the color palette of the image more readable.
1
2
Looks like symmetrizing the latents can also give interesting effects. Though it is extremely sensitive to this - you have to still have 50% or more of non-symmetric noise or you get stuff like the image on the right instead.
6
Prompts at each scale and messing with masking the latents gives a lot of knobs to turn to try to get specific results, but I'm not sure this is really the most intuitive toolset for controlling SD...
1
2
That was done using 7 different prompts and a sigmoid multiplier on the latents to make it generate the ring in the center. But I'm not sure its any different than you could get by just asking for 'magical ring made of ice'?
1
1
And for sake of utter chaos, all 7 attention layers with different prompts: An angel, a sunset, a fire-based villain, a dinosaur riding a motorcycle, three rings, a steampunk airship, and a colorful oil-water mixture.
3
Interestingly, I don't think its so much coarse vs fine, as opposed to 'early vs late'. Here the downward pass uses one prompt, and the upward pass uses the other (left is 'tree first, then leopard', right is the reverse).
2
2
The interesting thing is that the prompts used for the upscaling bit do matter, but they don't actually matter with regards to the content exactly. They seem to have subtle effects on composition and texture.
2
4
Attempt at using different prompts at different scales of the UNet. This uses 'A beautiful, atmospheric painting of a tree atop a cliff face.' at all but the three largest scales, and 'A closeup macro photograph of a leopard's spots.' for the three coarsest scales.
2
1
10
Same latent, but instead using the tree for coarse and the leopard for fine.
6
What's the best way to inject local experimental modifications to UNet2DConditionModel in diffusers Stable Diffusion, such that it still works with the pretrained model? It looks like the pretrained model asks for a specific class...
2
1
2
I have an extremely hacky solution that works right now, which is to directly replace the 'forward' method after loading the model with my own method, e.g. pipe.unet.forward = MyClass.forward.__get__(pipe.unet, MyClass)
1
1
For the Stable Diffusion 75 token limit, that comes from CLIP right? So any reason you couldn't CLIP-embed 10 or 20 prompts and just stack them for SD's UNet? If there are positional encodings, just use within-prompt coordinates...
1
1