Here is 4 step process to generate images using stable diffusion API
-
- Get the API key from stablediffusionapi.com
- Verify Parameters
- Make API call
- Get Generated Image
1. Get the API key
In order to get the API key, register to stablediffusionapi.com You will get the API key after you register on the platform, Copy this and keep it in a safe place. this will be required later to generate images.
You can generate new API keys as well as per your needs.
2. Verify Parameters
Following are the parameters which you can pass to stable diffusion API
Your API Key here
Input prompt
Width of the output image. The maximum size is 1024x768 or 768x1024 because of memory limits
Height of output image. The maximum size is 1024x768 or 768x1024 because of memory limits
Initial image to generate variations of. Will be resized to the specified width and height
Black and white image to use as a mask for inpainting over init_image. Black pixels are inpainted and white pixels are preserved. Experimental feature tends to work better with prompt strength of 0.5-0.7
Prompt strength when using init image. 1.0 corresponds to the full destruction of information in the init image
Number of denoising steps
Scale for classifier-free guidance
Random seed. Leave blank to randomize the seed
3. Make API Call
You can use Curl, or an HTTP API call library to make an API call. You can find all sample codes in the documentation URL
https://documenter.getpostman.com/view/18679074/2s83zdwReZ
4. Get Generated Image
If all is good, you will get generated image in response, it will be an image link that you can download or see in the browser

