OpenAIImageToImageGenerationWrapper
Python template · sinapsis_openai.templates.openai_images
Overview
Template that wraps the `OpenAI.images.edit` API endpoint to perform image-to-image generation tasks. This template excludes the `image`, `prompt`, `model`, and `response_format` attributes from the API caller. Instead, the image is provided through the attribute `path_to_image` in the `AttributesBaseModel`. The PACKAET_TYPE_NAME indicates that this template processes packets stored in the image field of the DataContainer as the prompt
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-openai==1.0.0uv pip install sinapsis-openai==1.0.0uv add sinapsis-openai==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Required
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
The fixed image model used for image generation tasks. path_to_image (str): The file path of the original image to be used as input for image-to-image generation. openai_init api_key typing.Union[str,… Read full field description
The fixed image model used for image generation tasks. path_to_image (str): The file path of the original image to be used as input for image-to-image generation. openai_init api_key typing.Union[str, typing.Callable[[], str], NoneType]: default: None admin_api_key typing.Optional[str]: default: None workload_identity typing.Any: default: None organization typing.Optional[str]: default: None project typing.Optional[str]: default: None webhook_secret typing.Optional[str]: default: None provider typing.Any: default: None base_url typing.Any: default: None websocket_base_url typing.Any: default: None timeout typing.Any: default: NOT_GIVEN max_retries <class 'int'>: default: 2 default_headers typing.Optional[typing.Mapping[str, str]]: default: None default_query typing.Optional[typing.Mapping[str, object]]: default: None http_client typing.Any: default: None _strict_response_validation <class 'bool'>: default: False _enforce_credentials <class 'bool'>: default: Trueedit background typing.Any: default: <openai.Omit object at 0x74f9db285a90> input_fidelity typing.Any: default: <openai.Omit object at 0x74f9db285a90> mask typing.Any: default: <openai.Omit object at 0x74f9db285a90> n typing.Any: default: <openai.Omit object at 0x74f9db285a90> output_compression typing.Any: default: <openai.Omit object at 0x74f9db285a90> output_format typing.Any: default: <openai.Omit object at 0x74f9db285a90> partial_images typing.Any: default: <openai.Omit object at 0x74f9db285a90> quality typing.Any: default: <openai.Omit object at 0x74f9db285a90> size typing.Any: default: <openai.Omit object at 0x74f9db285a90> stream typing.Any: default: <openai.Omit object at 0x74f9db285a90> user typing.Any: default: <openai.Omit object at 0x74f9db285a90> extra_headers typing.Any: default: None extra_query typing.Any: default: None extra_body typing.Any: default: None timeout typing.Any: default: NOT_GIVEN
Optional
Default: "gpt-image-1"
Optional
Default: null
Required
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: 2
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: "url"
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: OpenAIImageToImageGenerationWrapper
class_name: OpenAIImageToImageGenerationWrapper
template_input: InputTemplate
attributes:
model: dall-e-2
response_format: url
path_to_image: '/path/to/image/to/be/edited'
openai_init:
api_key: openai_api_key
max_retries: 2
generate:
n: 1Show schema-based configuration skeleton
templates:
- template_name: "OpenAIImageToImageGenerationWrapper"
class_name: "OpenAIImageToImageGenerationWrapper"
attributes:
edit:
n: null
mask: null
size: null
user: null
stream: null
quality: null
timeout: null
background: null
extra_body: null
extra_query: null
extra_headers: null
output_format: null
input_fidelity: null
partial_images: null
output_compression: null
model: "gpt-image-1"
openai_init:
api_key: null
project: null
timeout: null
base_url: null
provider: null
http_client: null
max_retries: 2
organization: null
admin_api_key: null
default_query: null
webhook_secret: null
default_headers: null
workload_identity: null
websocket_base_url: null
response_format: "url"
Inheritance
sinapsis_openai.templates.openai_images.OpenAIImageToImageGenerationEnvironment variables
Environment definitions belong to their canonical Python modules.