Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
zcpua committed Jul 23, 2023
1 parent 87c2dd4 commit b008c51
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 39 deletions.
93 changes: 54 additions & 39 deletions example/variation-ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,60 @@ async function main() {
},
});
console.log("Variation", Variation);
client
.Variation({
index: 2,
msgId: <string>Imagine.id,
hash: <string>Imagine.hash,
flags: Imagine.flags,
loading: (uri: string, progress: string) => {
console.log("Variation2.loading", uri, "progress", progress);
},
})
.then((msg2) => {
console.log({ msg2 });
});
client
.Variation({
index: 3,
msgId: <string>Imagine.id,
hash: <string>Imagine.hash,
flags: Imagine.flags,
loading: (uri: string, progress: string) => {
console.log("Variation3.loading", uri, "progress", progress);
},
})
.then((msg3) => {
console.log({ msg3 });
});
client
.Variation({
index: 4,
msgId: <string>Imagine.id,
hash: <string>Imagine.hash,
flags: Imagine.flags,
loading: (uri: string, progress: string) => {
console.log("Variation4.loading", uri, "progress", progress);
},
})
.then((msg4) => {
console.log({ msg4 });
});
if (!Variation) {
console.log("no Variation");
return;
}
const Upscale = await client.Upscale({
index: 2,
msgId: <string>Variation.id,
hash: <string>Variation.hash,
flags: Variation.flags,
content: prompt,
loading: (uri: string, progress: string) => {
console.log("loading", uri, "progress", progress);
},
});
console.log(Upscale);
// client
// .Variation({
// index: 2,
// msgId: <string>Imagine.id,
// hash: <string>Imagine.hash,
// flags: Imagine.flags,
// loading: (uri: string, progress: string) => {
// console.log("Variation2.loading", uri, "progress", progress);
// },
// })
// .then((msg2) => {
// console.log({ msg2 });
// });
// client
// .Variation({
// index: 3,
// msgId: <string>Imagine.id,
// hash: <string>Imagine.hash,
// flags: Imagine.flags,
// loading: (uri: string, progress: string) => {
// console.log("Variation3.loading", uri, "progress", progress);
// },
// })
// .then((msg3) => {
// console.log({ msg3 });
// });
// client
// .Variation({
// index: 4,
// msgId: <string>Imagine.id,
// hash: <string>Imagine.hash,
// flags: Imagine.flags,
// loading: (uri: string, progress: string) => {
// console.log("Variation4.loading", uri, "progress", progress);
// },
// })
// .then((msg4) => {
// console.log({ msg4 });
// });
}
main().catch((err) => {
console.error(err);
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface MJConfigParam {
ApiInterval?: number; //ApiInterval request api interval
Limit?: number; //Limit of get message list
MaxWait?: number;
Remix?: boolean; //Remix:true use remix mode
Ws?: boolean; //Ws:true use websocket get discord message (ephemeral message)
HuggingFaceToken?: string; //HuggingFaceToken for verify human
SessionId?: string;
Expand Down

0 comments on commit b008c51

Please sign in to comment.