File size: 387 Bytes
e774b98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let job = await createJob({
	prompt: "puppies in a cloud, 4k",
});

console.log("Job Created! Waiting...");

while (job.status !== "succeeded" && job.status !== "failed") {
	await new Promise((resolve) => setTimeout(resolve, 250));

	job = await getJob(job.job);
}

if(job.status !== "succeeded") {
	throw new Error("Job failed!"); 
}

console.log("Generation completed!", job.imageUrl);