When I do a fetch on jobs I see "created_at", "started_at” parameters, what do they mean?
They represent the times of the different stages (see answer above) of the job submitted in epoch time. You can use this to convert to human-readable format https://www.epochconverter.com/
created_at | The time when the task was submitted to us (staged and/or pending) |
---|---|
started_at | The time when the task started processing |
ended_at | The time when the task finished processing |
Note: the time from created_at to time of started_at is time the job spent in the "staged“ stage and/or the"pending" stage if there were any.
What are frozen quotas?
🤖WEBHOOKS
Webhooks - I am having troubles with setting this up, what does your webhook header and body look like?
Account Notification Webhook Structure
{
"type": "go_api_quota_exchange_failed", //see table below column 2 for all notification types
"time": 1709035361,
"message": "Test",
"detail": {} //see table below column 3 for details of each notification types
}
Notification Type | "type" | "detail" |
---|---|---|
GoAPIQuotaExchangeFailed NotificationType | "go_api_quota_exchange_failed" | `{ |
"quota_type": "", // type of quota, MJ/gpts quota
"credis_remain": 0 // current remaining credits
}| | MJPenaltyTriggered | "mj_penalty_triggered" |
{
"penalty_type": "relax", // relax or error
"task_id": "", // the taskID that is triggering the error
"threshold": 100, // allowable daily error for this plan
"cap_usage": 101 // number of error already made today
}| | MJBotBannded | "mj_bot_banned" |
{
"bot_id": 1,
"bot_name": "example_bot",
"reason": "reason",
"block_until": 0 // if this value is equal to or less than 0, it means we can't obtain the block_until time, which means this might be a permanent ban
}| | MJBotSubscriptionExpired | "mj_bot_subscription_expired" |
{
"bot_id": 1,
"bot_name": "example_bot"
}| | NoActiveMJBot | "no_active_mj_bot" | No detail for this | | MJBotNoFasthour | "mj_bot_no_fasthour" |
{
"bot_id": 1,
"bot_name": "example_bot",
"subscription_plan": "pro"
}| | GPTAccountUnavailable | "gpt_account_unavailable" |
{
"gpt_account_id": 1,
"gpt_account_name": "name",
"reason": "xxx"
}| | GPTUsageLimitReached | "gpt_usage_limit_reached" |
{
"gpt_account_id": 1,
"gpt_account_name": "name",
"limit_until": 0 // when the limit will be lifted
}` |
FETCH
When I do a fetch on submitted tasks I get 4 pictures combined into one picture back. How do I get individual pictures?
You can download the returned picture and create a script to crop the pictures yourself; or;
You could use the upscale endpoint to enlarge one of the four pictures and get that one back. However upscale endpoint does incur costs as per pricing plan: https://piapi.ai/pricing
You can use the "Discord _urls" parameter from https://piapi.ai/docs/midjourney-api/task-result-explaination
Please see who has access to this parameter here: https://piapi.ai/docs/midjourney-api/fetch#access-to-optional-parameters
🌏INPAINT AN IMAGE
Can I do inpaint on an image multiple times?
Can we repeatedly do inpaint on an image?
Yes, below workflow is okay imagine - fetch - upscale -fetch- inpaint -fetch - upscale-fetch - inpaint-fetch.... (currently only support below left, not right)
Operation | Operating on task_ID: | Task_ID of this operation | Operation | Operating on task_ID: | Task_ID of this operation | |
---|---|---|---|---|---|---|
imagine | - | 1 | imagine | - | 1 | |
fetch | 1 | 2 | fetch | 1 | 2 | |
upscale | 2 | 3 | upscale | 2 | 3 | |
fetch | 3 | 4 | fetch | 3 | 4 | |
inpaint | 4 | 5 | inpaint | 4 | 5 | |
fetch | 5 | 6 | fetch | 5 | 6 | |
upscale | 6 | 7 | inpaint | 4 | 7 | |
fetch | 7 | 8 | fetch | 7 | 8 | |
inpaint | 8 | 9 | inpaint | 4 | 9 | |
fetch | 9 | 10 | fetch | 9 | 10 |