Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.
For more information about how Stable Diffusion functions, please have a look at
🤗's Stable Diffusion with 🧨Diffusers blog
.
For more information about the model, license and limitations check the original model card at
CompVis/stable-diffusion-v1-4
.
This repository implements a custom
handler
task for
text-to-image
for 🤗 Inference Endpoints. The code for the customized pipeline is in the
pipeline.py
.
There is also a
notebook
included, on how to create the
handler.py
expected Request payload
{"inputs":"A prompt used for image generation"}
below is an example on how to run a request using Python and
requests
.
Run Request
import json
from typing importListimport requests as r
import base64
from PIL import Image
from io import BytesIO
ENDPOINT_URL = ""
HF_TOKEN = ""# helper decoderdefdecode_base64_image(image_string):
base64_image = base64.b64decode(image_string)
buffer = BytesIO(base64_image)
return Image.open(buffer)
defpredict(prompt:str=None):
payload = {"inputs": code_snippet,"parameters": parameters}
response = r.post(
ENDPOINT_URL, headers={"Authorization": f"Bearer {HF_TOKEN}"}, json={"inputs": prompt}
)
resp = response.json()
return decode_base64_image(resp["image"])
prediction = predict(
prompt="the first animal on the mars"
)
expected output
Runs of philschmid stable-diffusion-v1-4-endpoints on huggingface.co
14
Total runs
3
24-hour runs
2
3-day runs
-4
7-day runs
-2
30-day runs
More Information About stable-diffusion-v1-4-endpoints huggingface.co Model
More stable-diffusion-v1-4-endpoints license Visit here:
stable-diffusion-v1-4-endpoints huggingface.co is an AI model on huggingface.co that provides stable-diffusion-v1-4-endpoints's model effect (), which can be used instantly with this philschmid stable-diffusion-v1-4-endpoints model. huggingface.co supports a free trial of the stable-diffusion-v1-4-endpoints model, and also provides paid use of the stable-diffusion-v1-4-endpoints. Support call stable-diffusion-v1-4-endpoints model through api, including Node.js, Python, http.
stable-diffusion-v1-4-endpoints huggingface.co is an online trial and call api platform, which integrates stable-diffusion-v1-4-endpoints's modeling effects, including api services, and provides a free online trial of stable-diffusion-v1-4-endpoints, you can try stable-diffusion-v1-4-endpoints online for free by clicking the link below.
philschmid stable-diffusion-v1-4-endpoints online free url in huggingface.co:
stable-diffusion-v1-4-endpoints is an open source model from GitHub that offers a free installation service, and any user can find stable-diffusion-v1-4-endpoints on GitHub to install. At the same time, huggingface.co provides the effect of stable-diffusion-v1-4-endpoints install, users can directly use stable-diffusion-v1-4-endpoints installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
stable-diffusion-v1-4-endpoints install url in huggingface.co: