Image Generation
These variables are set on the Hrida.ai container. Variables marked ConfigVar are saved to the database on first start — see how ConfigVar works before changing them later.
General Settings
ENABLE_IMAGE_GENERATION
- Type:
bool - Default:
False - Description: Enables or disables image generation features.
- Persistence: This environment variable is a
ConfigVarvariable.
ENABLE_IMAGE_PROMPT_GENERATION
- Type:
bool - Default:
True - Description: Enables or disables automatic enhancement of user prompts for better image generation results.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE
- Type:
str - Default:
None - Description: Specifies the template to use for generating image prompts.
- Persistence: This environment variable is a
ConfigVarvariable.
DEFAULT_IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE:
### Task:
Generate a detailed prompt for an image generation task based on the given language and context. Describe the image as if you were explaining it to someone who cannot see it. Include relevant details, colors, shapes, and any other important elements.
### Guidelines:
- Be descriptive and detailed, focusing on the most important aspects of the image.
- Avoid making assumptions or adding information not present in the image.
- Use the chat's primary language; default to English if multilingual.
- If the image is too complex, focus on the most prominent elements.
### Output:
Strictly return in JSON format:
{
"prompt": "Your detailed description here."
}
### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
Image Creation
IMAGE_GENERATION_ENGINE
- Type:
str - Options:
openai- Uses OpenAI DALL-E for image generation.comfyui- Uses ComfyUI engine for image generation.automatic1111- Uses AUTOMATIC1111 engine for image generation.gemini- Uses Gemini for image generation.
- Default:
openai - Description: Specifies the engine to use for image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_GENERATION_MODEL
- Type:
str - Default: ``
- Description: Default model to use for image generation (e.g.,
dall-e-3,gemini-2.0-flash-exp). - Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_SIZE
- Type:
str - Default:
512x512 - Description: Sets the default output dimensions for generated images in WIDTHxHEIGHT format (e.g.,
1024x1024). Set toautoto let the model determine the appropriate size (only supported by models matchingIMAGE_AUTO_SIZE_MODELS_REGEX_PATTERN). - Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_AUTO_SIZE_MODELS_REGEX_PATTERN
- Type:
str - Default:
^gpt-image - Description: A regex pattern to match model names that support
IMAGE_SIZE = "auto". When a model matches this pattern, theautosize option becomes available, allowing the model to determine the appropriate output dimensions. By default, only models starting withgpt-image(e.g.,gpt-image-1) are matched.
IMAGE_URL_RESPONSE_MODELS_REGEX_PATTERN
- Type:
str - Default:
^gpt-image - Description: A regex pattern to match model names that return image URLs directly instead of base64-encoded data. Models matching this pattern will not include
response_format: b64_jsonin API requests. By default, only models starting withgpt-imageare matched. For other models, Hrida.ai requests base64 responses and handles the conversion internally.
IMAGE_STEPS
- Type:
int - Default:
50 - Description: Sets the default iteration steps for image generation. Used for ComfyUI and AUTOMATIC1111 engines.
- Persistence: This environment variable is a
ConfigVarvariable.
Image Editing
ENABLE_IMAGE_EDIT
- Type:
boolean - Default:
true - Description: When disabled, Image Editing will not be used and instead, images will be created only using the image generation engine.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_EDIT_ENGINE
- Type:
str - Options:
openai- Uses OpenAI DALL-E for image editing.gemini- Uses Gemini for image editing.comfyui- Uses ComfyUI engine for image editing.
- Default:
openai - Description: Configures the engine used for image editing operations, enabling modification of existing images using text prompts.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_EDIT_MODEL
- Type:
str - Default: ``
- Description: Specifies the model to use for image editing operations within the selected engine (e.g.,
dall-e-2,gemini-2.5-flash). - Persistence: This environment variable is a
ConfigVarvariable.
IMAGE_EDIT_SIZE
- Type:
str - Default: ``
- Description: Defines the output dimensions for edited images in WIDTHxHEIGHT format (e.g.,
1024x1024). Leave empty to preserve original dimensions. - Persistence: This environment variable is a
ConfigVarvariable.
OpenAI DALL-E
Image Generation
IMAGES_OPENAI_API_BASE_URL
- Type:
str - Default:
${OPENAI_API_BASE_URL} - Description: Sets the OpenAI-compatible base URL to use for DALL-E image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_OPENAI_API_VERSION
- Type:
str - Default:
${OPENAI_API_VERSION} - Description: Optional setting. If provided it sets the
api-versionquery parameter when calling the image generation endpoint. Required for Azure OpenAI deployments. - Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_OPENAI_API_KEY
- Type:
str - Default:
${OPENAI_API_KEY} - Description: Sets the API key to use for DALL-E image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_OPENAI_API_PARAMS
- Type:
str(JSON) - Default:
{} - Description: Additional parameters for OpenAI image generation API in JSON format. Allows customization of API-specific settings such as quality parameters for DALL-E models (e.g.,
{"quality": "hd"}for dall-e-3). - Example:
{"quality": "hd", "style": "vivid"} - Persistence: This environment variable is a
ConfigVarvariable.
Image Editing
IMAGES_EDIT_OPENAI_API_BASE_URL
- Type:
str - Default:
${OPENAI_API_BASE_URL} - Description: Configures the OpenAI API base URL specifically for image editing operations, allowing separate endpoints from image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_OPENAI_API_VERSION
- Type:
str - Default: ``
- Description: Specifies the OpenAI API version for image editing, enabling support for Azure OpenAI deployments with versioned endpoints.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_OPENAI_API_KEY
- Type:
str - Default:
${OPENAI_API_KEY} - Description: Provides authentication for OpenAI image editing API requests, with support for separate keys from image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
Gemini
tip
For a detailed setup guide and example configuration, please refer to the Gemini Image Generation Guide.
Image Generation
IMAGES_GEMINI_API_BASE_URL
- Type:
str - Default:
${GEMINI_API_BASE_URL} - Description: Specifies the URL to Gemini's image generation API.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_GEMINI_API_KEY
- Type:
str - Default:
${GEMINI_API_KEY} - Description: Sets the Gemini API key for image generation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_GEMINI_ENDPOINT_METHOD
- Type:
str - Options:
predict- Uses the predict endpoint (default for Imagen models).generateContent- Uses the generateContent endpoint (for Gemini 2.5 Flash and newer models).
- Default: ``
- Description: Specifies the Gemini API endpoint method for image generation, supporting both legacy Imagen models and newer Gemini models with image generation capabilities.
- Persistence: This environment variable is a
ConfigVarvariable.
Image Editing
IMAGES_EDIT_GEMINI_API_BASE_URL
- Type:
str - Default:
${GEMINI_API_BASE_URL} - Description: Configures the Gemini API base URL for image editing operations with Gemini models.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_GEMINI_API_KEY
- Type:
str - Default:
${GEMINI_API_KEY} - Description: Provides authentication for Gemini image editing API requests.
- Persistence: This environment variable is a
ConfigVarvariable.
ComfyUI
Image Generation
COMFYUI_BASE_URL
- Type:
str - Default: ``
- Description: Specifies the URL to the ComfyUI image generation API (e.g.,
http://127.0.0.1:8188). - Persistence: This environment variable is a
ConfigVarvariable.
COMFYUI_API_KEY
- Type:
str - Default: ``
- Description: Sets the API key for ComfyUI authentication.
- Persistence: This environment variable is a
ConfigVarvariable.
COMFYUI_WORKFLOW
- Type:
str(JSON) - Default:
json
{
"3": {
"inputs": {
"seed": 0,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": ["4", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"4": {
"inputs": {
"ckpt_name": "model.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "Prompt",
"clip": ["4", 1]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "",
"clip": ["4", 1]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": ["3", 0],
"vae": ["4", 2]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}- Description: Defines the ComfyUI workflow configuration in JSON format. Export from ComfyUI using "Save (API Format)" to ensure compatibility.
- Persistence: This environment variable is a
ConfigVarvariable.
COMFYUI_WORKFLOW_NODES
- Type:
list[dict] - Default:
[] - Description: Specifies the ComfyUI workflow node mappings for image generation, defining which nodes handle prompt, model, dimensions, and other parameters. Configured automatically via the admin UI.
- Persistence: This environment variable is a
ConfigVarvariable.
Image Editing
IMAGES_EDIT_COMFYUI_BASE_URL
- Type:
str - Default: ``
- Description: Configures the ComfyUI base URL for image editing operations, enabling self-hosted ComfyUI workflows for image manipulation.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_COMFYUI_API_KEY
- Type:
str - Default: ``
- Description: Provides authentication for ComfyUI image editing API requests when the ComfyUI instance requires API key authentication.
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_COMFYUI_WORKFLOW
- Type:
str(JSON) - Default: ``
- Description: Defines the ComfyUI workflow configuration in JSON format for image editing operations. Must include nodes for image input, prompt, and output. Export from ComfyUI using "Save (API Format)".
- Persistence: This environment variable is a
ConfigVarvariable.
IMAGES_EDIT_COMFYUI_WORKFLOW_NODES
- Type:
list[dict] - Default:
[] - Description: Specifies the ComfyUI workflow node mappings for image editing, defining which nodes handle image input, prompt, model, dimensions, and other parameters. Configured automatically via the admin UI.
- Persistence: This environment variable is a
ConfigVarvariable.
AUTOMATIC1111
AUTOMATIC1111_BASE_URL
- Type:
str - Default: ``
- Description: Specifies the URL to AUTOMATIC1111's Stable Diffusion API (e.g.,
http://127.0.0.1:7860). - Persistence: This environment variable is a
ConfigVarvariable.
AUTOMATIC1111_API_AUTH
- Type:
str - Default: ``
- Description: Sets the AUTOMATIC1111 API authentication credentials if required.
- Persistence: This environment variable is a
ConfigVarvariable.
AUTOMATIC1111_PARAMS
- Type:
str(JSON) - Default:
{} - Description: Additional parameters in JSON format to pass to AUTOMATIC1111 API requests (e.g.,
{"cfg_scale": 7, "sampler_name": "Euler a", "scheduler": "normal"}). - Persistence: This environment variable is a
ConfigVarvariable.