generate_image
Create custom images from text prompts using AI, with options to save in various formats, resize, and apply compression settings for optimal file size.
Instructions
Generates an image based on a prompt and saves it to the specified path.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_name | No | The name of the image file to be saved (without extension). Defaults to 'generated_image'. | generated_image |
force_conversion_type | No | Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processed, defaulting to PNG for non-JPEG images. | |
input_image_paths | No | Optional. A list of file paths for input images to be used as a reference for generation. | |
jpeg_quality | No | JPEG quality (0-100). Lower values result in higher compression. Defaults to 80. | |
optipng_optimization_level | No | OptiPNG optimization level (0-7). Higher values result in higher compression. Defaults to 2. | |
output_directory | No | The directory path to save the image. Defaults to 'output/images'. | output/images |
png_compression_level | No | PNG compression level (0-9). Higher values result in higher compression. Defaults to 9. | |
prompt | Yes | Text prompt for image generation. If input images are provided, include instructions on how to use them to create the new image. English is recommended. | |
skip_compression_and_resizing | No | Whether to skip compression and resizing of the generated image. If true, `force_conversion_type` and `target_image_max_size` are ignored. Defaults to false. | |
target_image_max_size | No | The maximum length (in pixels) of the longest side of the resized image. The original aspect ratio is maintained. Defaults to 512. | |
use_enhanced_prompt | No | Whether to use an enhanced prompt to assist the AI's instructions. Defaults to true. | |
webp_quality | No | WebP quality (0-100). Lower values result in higher compression. Defaults to 80. |
Input Schema (JSON Schema)
{
"properties": {
"file_name": {
"default": "generated_image",
"description": "The name of the image file to be saved (without extension). Defaults to 'generated_image'.",
"type": "string"
},
"force_conversion_type": {
"description": "Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processed, defaulting to PNG for non-JPEG images.",
"enum": [
"jpeg",
"webp",
"png"
],
"type": "string"
},
"input_image_paths": {
"description": "Optional. A list of file paths for input images to be used as a reference for generation.",
"items": {
"description": "Absolute path of the image file.",
"type": "string"
},
"type": "array"
},
"jpeg_quality": {
"default": 80,
"description": "JPEG quality (0-100). Lower values result in higher compression. Defaults to 80.",
"maximum": 100,
"minimum": 0,
"type": "integer"
},
"optipng_optimization_level": {
"default": 2,
"description": "OptiPNG optimization level (0-7). Higher values result in higher compression. Defaults to 2.",
"maximum": 7,
"minimum": 0,
"type": "integer"
},
"output_directory": {
"default": "output/images",
"description": "The directory path to save the image. Defaults to 'output/images'.",
"type": "string"
},
"png_compression_level": {
"default": 9,
"description": "PNG compression level (0-9). Higher values result in higher compression. Defaults to 9.",
"maximum": 9,
"minimum": 0,
"type": "integer"
},
"prompt": {
"description": "Text prompt for image generation. If input images are provided, include instructions on how to use them to create the new image. English is recommended.",
"type": "string"
},
"skip_compression_and_resizing": {
"default": false,
"description": "Whether to skip compression and resizing of the generated image. If true, `force_conversion_type` and `target_image_max_size` are ignored. Defaults to false.",
"type": "boolean"
},
"target_image_max_size": {
"default": 512,
"description": "The maximum length (in pixels) of the longest side of the resized image. The original aspect ratio is maintained. Defaults to 512.",
"exclusiveMinimum": 0,
"type": "integer"
},
"use_enhanced_prompt": {
"default": true,
"description": "Whether to use an enhanced prompt to assist the AI's instructions. Defaults to true.",
"type": "boolean"
},
"webp_quality": {
"default": 80,
"description": "WebP quality (0-100). Lower values result in higher compression. Defaults to 80.",
"maximum": 100,
"minimum": 0,
"type": "integer"
}
},
"required": [
"prompt"
],
"type": "object"
}