ImageCon V2 is a powerful AI model that generates images based on provided parameters. It is a smaller image model that can generate squares of up to 512px and rectangles of up to 768px on the longest side. It is faster and suitable for most use cases.

For more details, visit the https://docs.worqhat.com/ai-models/image-generation/imagecon-v2.

Parameters

ParameterTypeDescriptionDefault
orientationStringThe orientation of the image. Options: Landscape, Portrait, Square.Square
image_styleStringThe style of the image.“default”
output_typeStringThe output type of the image. Options: url, blob. url returns the Cloud Hosted Link to the Image, blob returns the Base64 Image.url
promptArrayThe prompts for the image generation. This is a required parameter.-

Initialize AI Modules

const worqhat = require('worqhat');

var config = new worqhat.Configuration({
    apiKey: "your-api-key",
    debug: true,
    max_retries: 3,
});

worqhat.initializeApp(config);

let ai = worqhat.ai();

Implementation

ai.imageGeneration.v2({
    orientation: "square",
    image_style: "artistic",
    output_type: "url",
    prompt: [
        "A dog walking in a beach"
    ]
}).then((response) => {
    console.log(response);
}).catch((error) => {
    console.log(error);
});

Generate Images from Text using Image Gen Model V2

Generate Images from Text using Image Gen Model V2