Fast SDXL Image Generator Service
Description
Deploy a text-to-image pipeline as a service, using 'sdxl-turbo' by default.
Example Usage
from covalent_blueprints_ai import sdxl_basic
sdxl_blueprint = sdxl_basic()
sdxl_client = sdxl_blueprint.run()
prompt = "A beautiful sunset over the ocean."
num_inference_steps = 1
# Generate an image based on a prompt.
img_str = sdxl_client.generate(
prompt=prompt,
num_inference_steps=num_inference_steps,
)
# Display the image.
import base64
import io
from PIL import Image
buffer = io.BytesIO(base64.b64decode(img_str))
Image.open(buffer)
# Tear down the deployment.
sdxl_client.teardown()
Executors
text_to_image_service
GPUs:
1
CPUs:
25
GPU Type:
l40
Time Limit:
10800
Memory:
57344
Env:
sdxl-basic@blueprints
Environment
Pip Packages Added
torch
transformers[sentencepiece]
accelerate
diffusers
covalent-cloud
0.71.0rc0
covalent-blueprints
0.1.0
Arguments
model_name
stabilityai/sdxl-turbo
The name of the model to deploy. Defaults to "stabilityai/sdxl-turbo".
torch_dtype
float16
PyTorch data type (as string) for model parameters. Defaults to "float16".
variant
fp16
Model variant. Defaults to "fp16".
use_saved_model
true
Load the saved model from the cloud volume, if available. Defaults to True.
save_model_to_volume
false
Save the pretrained model to the cloud volume, overwriting if a copy already exists. Defaults to False.