SDXL API Optimization
We have successfully optimized our SDXL API, achieving a remarkable 45% increase in speed compared to our previous API and nearly 50% reduction in serving costs. These improvements significantly elevate the efficiency and affordability of our services, benefiting users with super-faster responses and lower expenses.
We've introduced two new parameters, optimize
and enhance
, both accepting Boolean values. When set to True, they enable the model to operate in a highly optimized manner, significantly enhancing processing speed.
Performance Improvements Overview
Our optimizations have been extensively tested across various scenarios and step counts. The outcomes demonstrate considerable performance improvements, with speed enhancements ranging from 24.15% to 44.96% across different samples and step counts.
Detailed Speed Improvements by Steps and Samples
# Samples | % Faster (30 Steps) | % Faster (40 Steps) | % Faster (50 Steps) |
---|---|---|---|
1 | 24.15% | 24.67% | 32.58% |
2 | 30.28% | 30.83% | 36.88% |
3 | 32.29% | 40.04% | 38.69% |
4 | 34.97% | 40.22% | 44.96% |
2x High-Speed, 50% Lower-Cost, Quality Uncompromised
Old Unoptimized API (Cost - 8 Credits, 30 Steps) | New Optimized API (Cost - 4 Credits, 30 Steps) |
---|---|
Round Trip Times: Before and After Optimization
# Samples | Unoptimized API (30 Steps) | Optimized API (30 Steps) | Unoptimized API (40 Steps) | Optimized API (40 Steps) | Unoptimized API (50 Steps) | Optimized API (50 Steps) |
---|---|---|---|---|---|---|
1 | 8.28s | 6.28s | 9.01s | 6.78s | 10.62s | 7.16s |
2 | 11.84s | 8.26s | 13.56s | 9.38s | 15.34s | 9.68s |
3 | 16.57s | 11.22s | 19.68s | 11.80s | 21.48s | 13.20s |
4 | 21.02s | 13.68s | 24.56s | 14.69s | 28.92s | 15.92s |
Try the New Optimized SDXL API
Try out our newly optimized API to see the improvements firsthand. The integration is straightforward:
import requests
url = "https://api.monsterapi.ai/v1/generate/sdxl-base"
payload = {
"enhance": True,
"optimize": True,
"safe_filter": True,
"prompt": "portrait of a model with raindrops in the foreground, wet look, slight smile, hyper-detailed skin texture illuminated by neon light, white dress, long hair, fickle face, perfect anatomy, wet-to-wet background technique by Misilbu. . hyper detailed 8k painting, 8k concept art portrait by Greg Rutkowski Artgerm WLOP Alphonse Beeple Caravaggio, muted colors, watercolor style, bokeh, f1.0 lens",
"samples": 3,
"steps": 40
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer YOUR_MONSTER_API_KEY"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Additional Resources -
Publish Date: 02-05-2024