Start Your First Server
Deploy a diffusion model with one command:http://localhost:8000. You’ll see:
The first run will download the model from HuggingFace, which may take several minutes.
Generate Images
Using OpenAI Python Client
Install the OpenAI client if you don’t have it:Using cURL
Test with cURL:Using Requests
Server Options
With Authentication
Secure your server with an API key:Custom Port
Run on a different port:Custom Data Type
Use bfloat16 for better quality on supported GPUs:With LoRA
Serve a model with a LoRA adapter:Common Use Cases
Serve SDXL
Serve FLUX.1
Serve SD 1.5
Serve with Custom Settings
Advanced Generation Parameters
Control Inference Steps
Use Negative Prompts
Set Random Seed
For reproducible results:Adjust Guidance Scale
Control adherence to prompt:Generate Multiple Images
Health Checks
Check Server Status
List Available Models
Complete Example Script
Save asgenerate.py:
Troubleshooting
Server won’t start
Issue: Port already in use Solution:CUDA out of memory
Issue: Model too large for GPU Solutions:-
Use a smaller model:
-
Use float16:
- Close other GPU applications
Slow generation
Issue: Generation takes too long Solutions:-
Reduce inference steps:
-
Use a faster model:
Connection refused
Issue: Can’t connect to server Checks:-
Is the server running?
-
Is the port correct?
-
Is the host correct?
Next Steps
Configuration
All server configuration options
Serving Overview
Understand the server architecture
Training
Train custom LoRAs to serve
Supported Models
See all compatible models