Stable Diffusion Authentication

You'll need to authenticate your requests to access any of the endpoints in the Diffute API. In this guide, we'll look at how authentication works.

HTTP Header

All requests to the Diffute API require an HTTP header, cleverly named x-api-key. The value for this key should be the API key generated from your Diffute dashboard.

Example request with x-api-key header

  curl --request PUT \
  --url https://api.diffute.com/v1/project/<organization_id>/<project_id>/media/inference \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: long-api-key/default' \
  --data '{
	"prompts": [
  {
    "name": "Ansel_Adams",
    "prompt": "A series of black and white photographs capturing the beauty and grandeur of Yosemite National Park",
    "num_images": 3,
    "height": 1024,
    "width": 768,
    "style": "photography in the style of Ansel Adams"
  },
  {
    "name": "Henri_Rousseau",
    "prompt": "A painting of a lush jungle scene with a variety of exotic plants and animals",
    "num_images": 3,
    "height": 1024,
    "width": 768,
    "style": "painting in the style of Henri Rousseau"
  },
  {
    "name": "Rachel_Ruysch",
    "prompt": "Still life painting featuring a variety of flowers and plants found in a garden",
    "num_images": 3,
    "height": 1024,
    "width": 768,
    "style": "painting in the style of Rachel Ruysch"
  }
	],
	"pretrained_model_name" : "stabilityai/stable-diffusion-xl-base-1.0",
	"name" : "Houston"
}'