We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience and analyze website traffic…

A short intro on running Stable Diffusion on DeepInfra

Published on 2023.03.08 by Iskren

A short intro on running Stable Diffusion on DeepInfra header picture

Pick a model

You can browse available text-to-image models on the models page.

For example, we'll use runwayml/stable-diffusion-v1-5.

Using the API

curl -X POST \
    -d '{"prompt": "A photo of a cube floating in space"}' \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -o cube.jpg \
    'https://api.deepinfra.com/v1/inference/runwayml/stable-diffusion-v1-5'
copy

And check out the output in cube.jpg.

Advanced options

You can check all the available settings on the model page or via the API documentation tab.