General Initialization
General Initialization
In[]:=
StableDiffusionSynthesize=ResourceFunction["https://www.wolframcloud.com/obj/nikm/DeployedResources/Function/StableDiffusionSynthesize/"];
In[]:=
$NetModelPath="/home/sw/Dropbox/GeneralBox/Research/LLMScience/FromNik";
In[]:=
sdOptions=Normal@<|TargetDevice->"GPU",AssociationMap[FileNameJoin[{$NetModelPath,"Parameters/Stable-Diffusion-V1",#<>".wlnet"}]&,{"Unet","Encoder","Decoder"}]|>;
Knockout targets
Knockout targets
In[]:=
unet=Import[Lookup[sdOptions,"Unet"]];
In[]:=
unet
Out[]=
NetGraph
In[]:=
Information[unet,"SummaryGraphic"]
Out[]=
In[]:=
Information[unet,"FullSummaryGraphic"]
Out[]=
$Aborted
In[]:=
Information[unet,"LayersGraph"]
Out[]=
In[]:=
Graph[%,AspectRatio->1/3]
Out[]=
Encoder, decode: downsampling, upsampling image
Encoder, decode: downsampling, upsampling image
Knockout
Knockout
In[]:=
StableDiffusionSynthesize["A cat in a party hat"->BlockRandom[SeedRandom[33];RandomReal[NormalDistribution[],{4,64,64}]],sdOptions]
Out[]=
Nik:StableDiffusionKnockout
In[]:=
unet=Import[Lookup[sdOptions,"Unet"]];
In[]:=
layers=Information[unet,"Layers"];
In[]:=
Length[%]
Out[]=
992
In[]:=
Take[layers,2]
Only some of these layers contain trainable weights...
[[[ In this picture we want to indicate with arrows where data comes in and goes out ... ]]]
Zeroing
Zeroing
Randomized:
Showing knockouts in their place
Showing knockouts in their place
This fluctuated because the time embedding got changed
Collapsing into blocks
Collapsing into blocks
Making a random image
Making a random image
Colors of individual pixels.... [what is the typical ImageHistogram of the world??]
LearnDistribution | “Diffusion”
LearnDistribution | “Diffusion”
Diffusion here means adding pixel noise [or latent space noise]
Training:
[[ Trains at each step of the diffusion ]]