Photomaker API Optimization
We've significantly improved our Photomaker API, achieving a remarkable 45% increase in speed compared to the previous version and cutting serving costs by nearly 50%. These enhancements greatly enhance the efficiency and affordability of our services, providing users with faster responses and lower expenses.
To achieve this, we've introduced a new parameter called "optimize," which accepts a Boolean value. Setting it to True enables the model to operate in a highly optimized mode, significantly boosting 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 26.06% to 44.77% across different samples and step counts.
Detailed Speed Improvements by Steps and Samples
Samples | 30 Steps (% Faster) | 40 Steps (% Faster) | 50 Steps (% Faster) |
---|---|---|---|
1 | 26.06% | 29.22% | 31.02% |
2 | 34.40% | 36.32% | 41.94% |
3 | 39.02% | 42.96% | 44.77% |
2x High-Speed, 50% Lower-Cost, Quality Uncompromised
Input Image | Old Unoptimized API (Cost - 8 Credits, 30 Steps, 3 Samples) | New Optimized API (Cost - 4 Credits, 30 Steps, 3 Samples) |
---|---|---|
Round Trip Times: Before and After Optimization
Samples | 30 steps (Optimized) | 30 steps (Unoptimized) | 40 steps (Optimized) | 40 steps (Unoptimized) | 50 steps (Optimized) | 50 steps (Unoptimized) |
---|---|---|---|---|---|---|
1 | 4.12s | 5.62s | 4.64s | 6.64s | 5.28s | 7.62s |
2 | 5.74s | 8.74s | 6.72s | 10.64s | 7.56s | 13.06s |
3 | 7.48s | 12.26s | 8.66s | 15.16s | 9.91s | 17.94s |
Try the New Optimized Photomaker 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/photo-maker"
payload = {
"samples": 1,
"seed": 42,
"optimize": True,
"steps": 30,
"prompt": "old man img as a Wizard with blue diamonds blue background , golden ratio, fake detail, trending pixiv fanbox, acrylic palette knife, style of makoto shinkai studio ghibli genshin impact james gilleard greg rutkowski chiho aoshima",
'init_image_url' :'https://engineering.nyu.edu/sites/default/files/styles/square_large_default_1x/public/2018-06/yann-lecun.jpg?h=65172a10&itok=NItwgG8z'
}
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: 07-05-2024