Method:POST
Endpoint:https://api.vyro.ai/v1/imagine/api/generations
Generate images from text with our API, Generations. Sign up at https://platform.imagine.art/dashboard to get your API key, then include it in the header as a 'token bearer' to authenticate yourself.
1import { client, Status, GenerationStyle } from "imaginesdk";
2
3const main = async () => {
4 const imagine = client("<Your API key>");
5
6 const response = await imagine.generations(
7 "cat with big sword",
8 {
9 style: GenerationsStyle.IMAGINE_V5
10 }
11 );
12
13 if (response.status() === Status.OK) {
14 const image = response.data();
15 if (image) image.asFile("result.png");
16 }
17 else {
18 console.log(`Status Code: ${response.status()}`);
19 }
20};
21
22main();
Method:post
Endpoint:https://api.vyro.ai/v1/imagine/api/edits/remix
Experience the magic of Imagine's Image Remix feature, designed to breathe new life into your existing images.
1import { client, Status, RemixControl, RemixStyle } from "imaginesdk";
2
3const main = async () => {
4 const imagine = client("<Your API key>");
5
6 const response = await imagine.remix(
7 "Make sword bigger",
8 "image.png",
9 {
10 control: RemixControl.OPENPOSE,
11 style: RemixStyle.IMAGINE_V1
12 }
13 );
14
15 if (response.status() === Status.OK) {
16 const image = response.data();
17 if (image) image.asFile("result.png");
18 }
19 else {
20 console.log(`Status Code: ${response.status()}`);
21 }
22};
23
24main();
Method:post
Endpoint:https://api.vyro.ai/v1/imagine/api/edits/inpaint
Inpaint is an advanced feature of the Text-to-Image Stable Diffusion pipeline. It allows users to remove unwanted objects or elements from an image by intelligently filling in the missing areas.
1import { client, Status, InpaintStyle } from "imaginesdk";
2
3const main = async () => {
4 const imagine = client("<Your API key>");
5
6 const response = await imagine.inpaint(
7 "Make sword bigger",
8 "image.png",
9 "mask.png",
10 {
11 style: InpaintStyle.REALISM
12 }
13 );
14
15 if (response.status() === Status.OK) {
16 const image = response.data();
17 if (image) image.asFile("result.png");
18 }
19 else {
20 console.log(`Status Code: ${response.status()}`);
21 }
22};
23
24main();
Method:post
Endpoint:https://api.vyro.ai/v1/imagine/api/upscale
The image upscale feature provides a better image to the user by increasing its resolution.
1import { client, Status } from "imaginesdk";
2
3const main = async () => {
4 const imagine = client("<Your API key>");
5
6 const response = await imagine.upscale(
7 "image.png",
8 );
9
10 if (response.status() === Status.OK) {
11 const image = response.data();
12 if (image) image.asFile("result.png");
13 }
14 else {
15 console.log(`Status Code: ${response.status()}`);
16 }
17};
18
19main();
Method:post
Endpoint:https://api.vyro.ai/v1/imagine/api/generations/variations
Variate allows the user to regenerate the image, taking into consideration the elements of the initial output of the generations feature. This feature ensures continual refinement of the image, enhancing its alignment with the user's specifications.
1import { client, Status, VariationStyle } from "imaginesdk";
2
3const main = async () => {
4 const imagine = client("<Your API key>");
5
6 const response = await imagine.variations(
7 "cat with big sword",
8 {
9 style: VariationStyle.DISNEY
10 }
11 );
12
13 if (response.status() === Status.OK) {
14 const image = response.data();
15 if (image) image.asFile("result.png");
16 }
17 else {
18 console.log(`Status Code: ${response.status()}`);
19 }
20};
21
22main();
Method:POST
Endpoint:https://api.vyro.ai/v1/imagine/api/background/remover
Remove the background of your image right now
1const url = "https://api.vyro.ai/v1/imagine/api/background/remover";
2
3const headers = new Headers();
4headers.append("Authorization", "Bearer <your api token>");
5
6const formdata = new FormData();
7formdata.append("image", "image.png");
8
9const requestOptions = {
10 method: 'POST',
11 body: formdata,
12 headers: headers,
13};
14
15fetch(url, requestOptions)
16 .then(response => response.text())
17 .then(result => console.log(result))
18 .catch(error => console.log("error", error));