openai_image_generation_driver
OpenAiImageGenerationDriver
Bases: BaseImageGenerationDriver
Driver for the OpenAI image generation API.
Attributes:
Name | Type | Description |
---|---|---|
model |
OpenAI model, for example 'dall-e-2' or 'dall-e-3'. |
|
api_type |
Optional[str]
|
OpenAI API type, for example 'open_ai' or 'azure'. |
api_version |
Optional[str]
|
API version. |
base_url |
Optional[str]
|
API URL. |
api_key |
Optional[str]
|
OpenAI API key. |
organization |
Optional[str]
|
OpenAI organization ID. |
style |
Optional[str]
|
Optional and only supported for dall-e-3, can be either 'vivid' or 'natural'. |
quality |
Union[Literal['standard'], Literal['hd']]
|
Optional and only supported for dall-e-3. Accepts 'standard', 'hd'. |
image_size |
Union[Literal['256x256'], Literal['512x512'], Literal['1024x1024'], Literal['1024x1792'], Literal['1792x1024']]
|
Size of the generated image. Must be one of the following, depending on the requested model: dall-e-2: [256x256, 512x512, 1024x1024] dall-e-3: [1024x1024, 1024x1792, 1792x1024] |
response_format |
Literal['b64_json']
|
The response format. Currently only supports 'b64_json' which will return a base64 encoded image in a JSON object. |
Source code in griptape/drivers/image_generation/openai_image_generation_driver.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|