Skip to content

Commit

Permalink
add DescribeByBlob
Browse files Browse the repository at this point in the history
  • Loading branch information
zcpua committed Jul 16, 2023
1 parent be5336b commit 0f285e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/midjourney.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ export class Midjourney extends MidjourneyMessage {
}
return wsClient.waitDescribe(nonce);
}
async DescribeByBlob(blob: Blob) {
const wsClient = await this.getWsClient();
const nonce = nextNonce();
const DcImage = await this.MJApi.UploadImageByBole(blob);
this.log(`Describe`, DcImage);
const httpStatus = await this.MJApi.DescribeApi(DcImage, nonce);
if (httpStatus !== 204) {
throw new Error(`DescribeApi failed with status ${httpStatus}`);
}
return wsClient.waitDescribe(nonce);
}

async Shorten(prompt: string) {
const wsClient = await this.getWsClient();
Expand Down

0 comments on commit 0f285e3

Please sign in to comment.