promptzero
v1.0.9
Published
Wrapper around graphql client to support PromptZero.com
Downloads
1
Readme
Install
yarn add promptzero
Example
Here is an example
import { initPromptZero } from "promptzero";
const promptZero = await initPromptZero("<API_KEY>");
const newPrompt = await promptZero.requestNewPrompt("cheese");
const promptId = newPrompt.data.requestNewPrompt.id;
const { error, data } = await promptZero.waitOnResult(promptId);
if (error !== null) {
console.error("error:", error);
} else {
if (data.result?.__typename === "Result_StableDiffusionV1_4") {
console.log(data.result.images.map((i) => i.url));
}
}