WOLFRAM NOTEBOOK

In[]:=
BlockRandom[SeedRandom[5323];ResourceFunction["StableDiffusionSynthesize"][{"cat","dog","chair","house","balloon","clock"}]]
Out[]=
In[]:=
Row[Map[Labeled[#,Style[Text[CommonName[ImageIdentify[Show[#,ImageSize->100]]]],11]]&,%],Spacer[4]]
Out[]=
In[]:=
Quit
In[]:=
ResourceUpdate["StableDiffusionSynthesize"]
ResourceObject
:The most recent version of resource 931345fa-89a3-4152-be66-dc076a4536ea is already downloaded.
Out[]=
In[]:=
BlockRandom[SeedRandom[33];ResourceFunction["StableDiffusionSynthesize"]["A cat in a party hat"]]
Out[]=
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"}]|>;
In[]:=
BlockRandom[SeedRandom[33];StableDiffusionSynthesize["A cat in a party hat",sdOptions]]
Import
:File /home/sw/Dropbox/GeneralBox/Research/LLMScience/FromNik/Parameters/Stable-Diffusion-V1/UNet.wlnet not found during Import.
Out[]=
In[]:=
SystemOpen["/home/sw/Dropbox/GeneralBox/Research/LLMScience/FromNik/Parameters/Stable-Diffusion-V1"]
Out[]=
$Failed
In[]:=
SetDirectory["/home/sw/Dropbox/GeneralBox/Research/LLMScience/FromNik/Parameters/Stable-Diffusion-V1"]
Out[]=
/home/sw/Dropbox/GeneralBox/Research/LLMScience/FromNik/Parameters/Stable-Diffusion-V1
In[]:=
FileNames[]
Out[]=
{tokenizer_test.h5,unet_test.h5,uninitialized_Decoder.wlnet,uninitialized_Encoder.wlnet,uninitialized_Unet.wlnet}
In[]:=
(*https://the-eye.eu/public/AI/cah/laion5b/embeddings/laion2B-en/img_emb/img_emb_0033.npyconvertedtoHDF5,1.44GB*)embeddings=Import["https://www.wolframcloud.com/obj/wolframphysics/img_emb_0033.h5","embeddings"];
In[]:=
Length[embeddings]
Out[]=
939123
In[]:=
randomSample=BlockRandom[SeedRandom[1];RandomChoice[embeddings,100]];
In[]:=
images=DeleteMissing@ParallelMap[Enclose[Confirm[ResourceFunction["LAIONSearch"][#,1]][1,"image"],Missing[]&]&,randomSample];
In[]:=
GraphicsGrid[Partition[images,12],Frame->All,FrameStyle->Gray]
Out[]=
In[]:=
images=DeleteMissing@ParallelMap[Enclose[Confirm[ResourceFunction["LAIONSearch"][#,1,"AestheticScore"->1]][1,"image"],Missing[]&]&,randomSample];
In[]:=
GraphicsGrid[Partition[images,12],Frame->All,FrameStyle->Gray]
Out[]=
In[]:=
images=DeleteMissing@ParallelMap[Enclose[Confirm[ResourceFunction["LAIONSearch"][#,1,"AestheticScore"->0]][1,"image"],Missing[]&]&,randomSample];
In[]:=
GraphicsGrid[Partition[images,12],Frame->All,FrameStyle->Gray]
Out[]=

Large run

CA

Zerify

1D

Color Distribution

Drugging etc.

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.