Model Dall-e-3
const OpenAI = require('openai')
const { HttpsProxyAgent } = require('https-proxy-agent')
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL)
});
const image = await openai.images.generate({ model: "dall-e-3", prompt: "A Yamaha-R1M motocycle on a racing loop" })
console.log(image.data)
/**
* response as the following
{
created: 1699706639,
data: [
{
revised_prompt: "Imagine a spectacular scene highlighting the exhilarating speed of a performance motorcycle. The chosen masterpiece for this scene is a Yamaha R1M superbike. This motorcycle, noted for its famous blue and silver color scheme, streamlined bodywork, and aggressive stance, is tearing down the tarmac of a professional racing circuit. The curving track unfolds ahead, peppered with various turns and straights. The sky overhead is clear blue, hinting at a perfect day for racing. Around the track, lush green grass can be seen, with grandstands filled with passionate fans blurred in the distance by the bike's breakneck speed.",
url: "https://oaidalleapiprodscus.blob.core.windows.net/private/org-WSyZFeLfl4GunqkwF8NyKhld/user-3ONiB79gR1lOQYjaFTE7Vxrw/img-sAidNcWnr8RnNFEwbwOvorzs.png?st=2023-11-11T11%3A43%3A59Z&se=2023-11-11T13%3A43%3A59Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-10T21%3A43%3A49Z&ske=2023-11-11T21%3A43%3A49Z&sks=b&skv=2021-08-06&sig=YL08ieve0HNV/pwVx4tkAyICi8AlCpNpcCLTCQrNJ1c%3D",
},
],
}
*/
const image = await openai.images.generate({
model: "dall-e-3",
prompt: "For iOS app background usuage, a reverse transformer, a power net, a house with powerwall installed, the electric line are connect between these object and the power flow can be seen" ,
quality: 'hd',
size: '1024x1792',
style: 'vivid' || 'natural'
})
console.log(image.data)
/**
* {
created: 1700057974,
data: [
{
revised_prompt: "Design an image portraying a system of sustainable energy for use as an iOS app background. Incorporate a reverse transformer, a robust power grid, and a household with an installed powerwall. Depict the line connections between these elements and visualize the power flow through the system. The style should be sleek, modern, and visually appealing, to match the aesthetic of a refined, forward-thinking tech application.",
url: "https://oaidalleapiprodscus.blob.core.windows.net/private/org-WSyZFeLfl4GunqkwF8NyKhld/user-3ONiB79gR1lOQYjaFTE7Vxrw/img-JJvfjkls9xVEJMSHSOtcogzw.png?st=2023-11-15T13%3A19%3A34Z&se=2023-11-15T15%3A19%3A34Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-14T23%3A31%3A56Z&ske=2023-11-15T23%3A31%3A56Z&sks=b&skv=2021-08-06&sig=xwnH9W%2B4modsNjz3JWNKKLMk40P2Ma17Daj7svO0Ejo%3D",
},
],
}
*/
const image = await openai.images.generate({
model: "dall-e-3",
prompt: "Describe a futuristic energy-efficient countryside house featuring a big solar power panel on the roof, a Powerwall installed, and a power grid. The house is connected to a reserve transformer (RT), ensuring a steady flow of electricity. The power flow can be visually observed in the electric wires. The setting should evoke a sense of technological advancement and sustainability.",
quality: 'hd',
size: '1024x1792',
style: 'vivid' || 'natural'
})
console.log(image)
/**
* {
created: 1700059710,
data: [
{
revised_prompt: "Imagine a high-tech, eco-friendly rural home nestled within the tranquil countryside of the future. This domicile boasts a significant solar power panel unit elegantly installed on its roof, harnessing the energy of the sun. An efficient Powerwall installation is prominently featured, signifying a seamless integration of modern technology with daily living. This house is connected to an essential reserve transformer (RT), guaranteeing a constant, uninterrupted electricity supply. Opportunity to visualize the smooth, constant power flow through the lifeline of electric wires. The scene should embody an intense sense of progress, interwoven with deep respect for sustainable habits.",
url: "https://oaidalleapiprodscus.blob.core.windows.net/private/org-WSyZFeLfl4GunqkwF8NyKhld/user-3ONiB79gR1lOQYjaFTE7Vxrw/img-jXicihQNM4b6nmfGMapdIAE4.png?st=2023-11-15T13%3A48%3A30Z&se=2023-11-15T15%3A48%3A30Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-15T14%3A37%3A02Z&ske=2023-11-16T14%3A37%3A02Z&sks=b&skv=2021-08-06&sig=C98Qe3VWHUbLrfwG0BQhwDQGLHXZG9IJW2gDTCnAves%3D",
},
],
}
*/
const image = await openai.images.generate({
model: "dall-e-3",
prompt:
"a futuristic energy-efficient countryside house in the center of the image, a big solar power panel on the roof, a Powerwall installed on the wall, and a power grid. The house is connected to a reserve transformer (RT), ensuring a steady flow of electricity. The power flow can be visually observed in the electric wires. The setting should evoke a sense of technological advancement and sustainability.a futuristic energy-efficient countryside house in the center of the image, a big solar power panel on the roof, a Powerwall installed on the wall, and a power grid. The house is connected to a reserve transformer (RT), ensuring a steady flow of electricity. The power flow can be visually observed in the electric wires. The setting should evoke a sense of technological advancement and sustainability.",
quality: "hd",
size: "1024x1792",
style: "vivid" || "natural",
});
console.log(image);
/**
*
* {
created: 1700280377,
data: [
{
revised_prompt: "Visualize a scene with a futuristic, energy-efficient house nestled in the countryside. It sits in the center of the image, with a large solar panel dominating its roof. On one of the exterior walls, a powerful battery is visible, indicative of a self-reliant energy system. This house is seamlessly connected to a reserve transformer, ensuring a consistent supply of electricity that can be depicted through visible electric lines. The whole setting should bring to the fore elements of cutting-edge technology and sustainability, signifying a step forward in green living and energy independence.",
url: "https://oaidalleapiprodscus.blob.core.windows.net/private/org-WSyZFeLfl4GunqkwF8NyKhld/user-3ONiB79gR1lOQYjaFTE7Vxrw/img-G2DcNWQXq0sSG5UX1pm4GVhj.png?st=2023-11-18T03%3A06%3A17Z&se=2023-11-18T05%3A06%3A17Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-17T20%3A06%3A41Z&ske=2023-11-18T20%3A06%3A41Z&sks=b&skv=2021-08-06&sig=6W4HLhIRbHGxhrq/IU614lKb4VFJesl0bShhcq1cOjQ%3D",
},
],
}
*/
const image = await openai.images.generate({
model: 'dall-e-3',
prompt: "Visualize a scene with a futuristic, energy-efficient house nestled in the countryside. It sits in the center of the image, with a large solar panel dominating its roof. Clear green dustless lawns are around the house. On one of the exterior walls, a powerful battery is visible, indicative of a self-reliant energy system. This house is seamlessly connected to a reserve transformer, ensuring a consistent supply of electricity that can be depicted through visible electric lines. The whole setting should bring to the fore elements of cutting-edge technology and sustainability, signifying a step forward in green living and energy independence.",
quality: "hd",
size: "1024x1792",
style: "vivid" || "natural",
})
console.log(image)
/**
* {
created: 1700280923,
data: [
{
url: "https://oaidalleapiprodscus.blob.core.windows.net/private/org-WSyZFeLfl4GunqkwF8NyKhld/user-3ONiB79gR1lOQYjaFTE7Vxrw/img-BK86rCFcNhzIgbH2GOQuAUx7.png?st=2023-11-18T03%3A15%3A23Z&se=2023-11-18T05%3A15%3A23Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-17T19%3A50%3A03Z&ske=2023-11-18T19%3A50%3A03Z&sks=b&skv=2021-08-06&sig=sD3AZsWhoisb3pqIOoRy9ydeJ4Z9HEgRfvzQm5iZuvY%3D",
},
],
}
*/