Stable Diffusion has been used to generate millions of images since its release. This tutorial will demonstrate how to use Loom to interact with Stable Diffusion via Automatic1111's API. Note that this is not a tutorial on how to install or use Stable Diffusion. A working Automatic1111 installation is required to proceed.
Working Automatic1111 WebUI setup.
<aside> đź’ˇ
Note: API features must be enabled by using “set COMMANDLINE_ARGS=--listen --api” to webui-user.bat in the root folder of your installation
</aside>
Open Loom and create a new project called “sdtests”
Select Edit > Open Project Folder
<aside> đź’ˇ Note: This method may only be compatible with Windows, Mac, and standard Linux setups. If it does not work, you may need to manually navigate to the project folder.
</aside>
Using your file explorer, open the /src folder, then open /dependencies
Extract the contents of auto1111.zip into the /dependencies folder
Return to Loom and select Edit > Insert Filter
Navigate to the /dependencies folder and insert text2img.loom
Observe the text2img module.
Properties from top to bottom:
URL - the URL and port of your implementation of Automatic1111’s WebUI
Prompt- The description of the image you want to create
Neg Prompt- the negative prompt or the description of what you don’t want in the image
Styles- comma delimited list of styles. These styles are defined in the webui.
Width - the width of the image in pixels
Height - the height of the image in pixels
Steps - the number of steps for generating the image
CFG Scale - the CFG scale of the generation.
Seed - Generation seed
Enable HR - For enabling the High Resolution Fix option. Use to upscale your images
HR Scale - The scale factor for the upscaled image
HR Upscaler - The name of the upscaler
HR Steps - The number of steps calculated when upscaling
Denoise Strength - Denoising strength for upscaler
Now all there is to do is configure the properties to our liking, connect an Img-Probe node to the img64 output, and click the run button.
Here are some good Stable Diffusion models that I use: