forked from erictik/midjourney-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request erictik#165 from erictik:shorten
add shorten
- Loading branch information
Showing
7 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import "dotenv/config"; | ||
import { Midjourney } from "../src"; | ||
/** | ||
* | ||
* a simple example of using the shorten api | ||
* ``` | ||
* npx tsx example/shorten.ts | ||
* ``` | ||
*/ | ||
async function main() { | ||
const client = new Midjourney({ | ||
ServerId: <string>process.env.SERVER_ID, | ||
ChannelId: <string>process.env.CHANNEL_ID, | ||
SalaiToken: <string>process.env.SALAI_TOKEN, | ||
Debug: true, | ||
Ws: true, | ||
}); | ||
await client.Connect(); | ||
const Shorten = await client.Shorten( | ||
"Peeking out from the bushes, masterpiece, octane rendering, focus, realistic photography, colorful background, detailed, intricate details, rich colors, realistic style" | ||
); | ||
console.log(Shorten); | ||
client.Close(); | ||
} | ||
main().catch((err) => { | ||
console.log("finished"); | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters