import fetch from 'node-fetch';
const payload = {
"text_prompt": "a man wearing a burberry scarf, anime fantasy illustration by Greg rutkowski, yoji shinkawa, 4k, digital art, concept art, trending on artstation, featured on pixiv, cinematic composition, dramatic pose, beautiful lighting, sharp details, hyper-detailed,",
"dall_e_3_quality": "standard",
"dall_e_3_style": "vivid",
"selected_models": [
"sd_2",
"sd_1_5",
"dall_e"
],
"image_guidance_scale": 1.2
};
async function gooeyAPI() {
const response = await fetch("https://api.gooey.ai/v2/CompareText2Img?example_id=jW99kLRAtsw", {
method: "POST",
headers: {
"Authorization": "bearer " + process.env["GOOEY_API_KEY"],
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
if (!response.ok) {
throw new Error(response.status);
}
const result = await response.json();
console.log(response.status, result);
}
gooeyAPI();