Image Generation
Image to Image Generation V2
Modify Images using Image to Image Generation V2
Function for modifying images using version 2 of the API. It sends a request to the Image Modification V2 AI Model and returns the new image. Read more about the model here https://docs.worqhat.com/ai-models/image-generation/image-image-v2
Parameters
Parameter | Type | Description |
---|---|---|
existing_image | File or string | The existing image to be modified. It can be a File object , a URL , or base64 encoded image data. This is a required parameter. |
modifications | string | The modifications to be made to the image. This is a required parameter. |
outputType | url blob | The output type of the modified image. It can be either url or blob . This is an optional parameter. |
similarity | number | The similarity percentage for the image modification. 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.imageVariations.v3({
existing_image: '1692628607418.png',
outputType: 'url',
modification: 'change the background to yellow',
similarity: 70
}).then((response) => {
console.log(response);
}).catch((error) => {
console.log(error);
});
Was this page helpful?