|
8 | 8 | from .._types import FileTypes
|
9 | 9 | from .image_model import ImageModel
|
10 | 10 |
|
11 |
| -__all__ = ["ImageEditParams"] |
| 11 | +__all__ = ["ImageEditParamsBase", "ImageEditParamsNonStreaming", "ImageEditParamsStreaming"] |
12 | 12 |
|
13 | 13 |
|
14 |
| -class ImageEditParams(TypedDict, total=False): |
| 14 | +class ImageEditParamsBase(TypedDict, total=False): |
15 | 15 | image: Required[Union[FileTypes, List[FileTypes]]]
|
16 | 16 | """The image(s) to edit. Must be a supported image file or an array of images.
|
17 | 17 |
|
@@ -40,6 +40,13 @@ class ImageEditParams(TypedDict, total=False):
|
40 | 40 | be set to either `png` (default value) or `webp`.
|
41 | 41 | """
|
42 | 42 |
|
| 43 | + input_fidelity: Optional[Literal["high", "low"]] |
| 44 | + """ |
| 45 | + Control how much effort the model will exert to match the style and features, |
| 46 | + especially facial features, of input images. This parameter is only supported |
| 47 | + for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. |
| 48 | + """ |
| 49 | + |
43 | 50 | mask: FileTypes
|
44 | 51 | """An additional image whose fully transparent areas (e.g.
|
45 | 52 |
|
@@ -72,6 +79,14 @@ class ImageEditParams(TypedDict, total=False):
|
72 | 79 | `jpeg`, or `webp`. The default value is `png`.
|
73 | 80 | """
|
74 | 81 |
|
| 82 | + partial_images: Optional[int] |
| 83 | + """The number of partial images to generate. |
| 84 | +
|
| 85 | + This parameter is used for streaming responses that return partial images. Value |
| 86 | + must be between 0 and 3. When set to 0, the response will be a single image sent |
| 87 | + in one streaming event. |
| 88 | + """ |
| 89 | + |
75 | 90 | quality: Optional[Literal["standard", "low", "medium", "high", "auto"]]
|
76 | 91 | """The quality of the image that will be generated.
|
77 | 92 |
|
@@ -101,3 +116,26 @@ class ImageEditParams(TypedDict, total=False):
|
101 | 116 | and detect abuse.
|
102 | 117 | [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
103 | 118 | """
|
| 119 | + |
| 120 | + |
| 121 | +class ImageEditParamsNonStreaming(ImageEditParamsBase, total=False): |
| 122 | + stream: Optional[Literal[False]] |
| 123 | + """Edit the image in streaming mode. |
| 124 | +
|
| 125 | + Defaults to `false`. See the |
| 126 | + [Image generation guide](https://platform.openai.com/docs/guides/image-generation) |
| 127 | + for more information. |
| 128 | + """ |
| 129 | + |
| 130 | + |
| 131 | +class ImageEditParamsStreaming(ImageEditParamsBase): |
| 132 | + stream: Required[Literal[True]] |
| 133 | + """Edit the image in streaming mode. |
| 134 | +
|
| 135 | + Defaults to `false`. See the |
| 136 | + [Image generation guide](https://platform.openai.com/docs/guides/image-generation) |
| 137 | + for more information. |
| 138 | + """ |
| 139 | + |
| 140 | + |
| 141 | +ImageEditParams = Union[ImageEditParamsNonStreaming, ImageEditParamsStreaming] |
0 commit comments