Serve open text-to-image models on Chalk GPUs
This demo shows how to run SDXL-Lightning on a Chalk GPU to generate images from text. Describe a picture to try it, then explore the code to see how it works.
Turn a prompt into an image, then try a variation
Choose a sample prompt and select Generate. Compare the image with the subject and style you asked for. Use New seed to try another variation of the same prompt. Requests share one GPU and may queue; the example app screens prompts and images, but those checks can miss unsafe content.
Choose a prompt and Generate. Chalk serves the image model on a GPU; compare the output with the requested subject, then try another seed.
Built on Chalk
Chalk builds the container and serves SDXL-Lightning on an NVIDIA L4. The example app turns each prompt into a 1024×1024 image and handles the queue and content checks.
A model ready to use
Deploy the model and its web app together. Chalk provisions the GPU and returns an HTTPS URL.
Deploy from Python
Define the container and its model weights in Python. Later builds can reuse cached image layers.
Call it from your app
Send a text prompt to your model’s HTTPS endpoint and get an image back. Use it in a product feature, a batch job, or an agent.
Content checks in your app
The example server filters prompts and screens generated images. Its generation budget and bounded queue limit work on the shared GPU.
Run it on your own
Clone the example, log in to Chalk, and run the deploy script. Chalk builds the image, provisions an NVIDIA L4, and prints the URL for your demo.
You will need uv and a Chalk environment with GPU capacity. Model weights download when the replica starts. Use the included Python client to generate an image from your own application.
git clone https://github.com/chalk-ai/text-to-image
cd text-to-image
# Or export CHALK_CLIENT_ID and CHALK_CLIENT_SECRET.
chalk login
# Builds the image, provisions a GPU, prints your demo's URL.
./deploy.py --gpu nvidia-l4Build image generation into your product
Serve an image model behind your own application. Talk to an engineer about running generation workloads on Chalk GPUs.