legnext-ruby-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +129 -0
  4. data/lib/openapi_client/api/account_management_api.rb +82 -0
  5. data/lib/openapi_client/api/image_api.rb +821 -0
  6. data/lib/openapi_client/api/video_api.rb +289 -0
  7. data/lib/openapi_client/api_client.rb +396 -0
  8. data/lib/openapi_client/api_error.rb +58 -0
  9. data/lib/openapi_client/api_model_base.rb +88 -0
  10. data/lib/openapi_client/configuration.rb +301 -0
  11. data/lib/openapi_client/models/api_v1_diffusion_post200_response.rb +205 -0
  12. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config.rb +156 -0
  13. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config.rb +156 -0
  14. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta.rb +156 -0
  15. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta_usage.rb +165 -0
  16. data/lib/openapi_client/models/api_v1_diffusion_post200_response_output.rb +168 -0
  17. data/lib/openapi_client/models/api_v1_edit_post200_response.rb +205 -0
  18. data/lib/openapi_client/models/api_v1_job_job_id_get200_response.rb +246 -0
  19. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_error.rb +175 -0
  20. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_meta.rb +174 -0
  21. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output.rb +177 -0
  22. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions.rb +224 -0
  23. data/lib/openapi_client/models/api_v1_pan_post200_response.rb +205 -0
  24. data/lib/openapi_client/models/balance_response.rb +167 -0
  25. data/lib/openapi_client/models/balance_response_data.rb +208 -0
  26. data/lib/openapi_client/models/task_response.rb +206 -0
  27. data/lib/openapi_client/version.rb +15 -0
  28. data/lib/openapi_client.rb +59 -0
  29. metadata +115 -0
@@ -0,0 +1,821 @@
1
+ =begin
2
+ #Midjourney api-unofficial by Legnext.ai
3
+
4
+ ## **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit** Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling. We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters. Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class ImageApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Blend
23
+ # ## Combine Multiple Images into Unified Creation Seamlessly blend 2-5 images together to create a single unique image that combines elements, styles, and concepts from all source images. ### How it Works Upload 2-5 image URLs and specify an aspect ratio. The API analyzes all images and creates a cohesive blend that merges their visual elements, colors, styles, and concepts. ### Required Parameters - `imgUrls` - Array of 2-5 image URLs to blend - `aspect_ratio` - Output aspect ratio: \"2:3\" (portrait), \"1:1\" (square), or \"3:2\" (landscape) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The blended images (4 variations) will be sent to your callback URL when complete (typically 60-90 seconds). ### Use Cases - Combine style references for unique visual concepts - Merge product photos with artistic styles - Create hybrid concepts from multiple references - Blend textures and patterns for design work - Mix character designs or architectural styles ### Tips - Works best with 2-3 images; more images create more abstract results - All source images should be publicly accessible URLs - The blend is conceptual, not a simple overlay - Consider the aspect ratio based on your intended use - Experiment with different image composition, color palettes, or subject matter for varied results.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_api_key
26
+ # @option opts [String] :body
27
+ # @return [TaskResponse]
28
+ def api_v1_blend_post(opts = {})
29
+ data, _status_code, _headers = api_v1_blend_post_with_http_info(opts)
30
+ data
31
+ end
32
+
33
+ # Blend
34
+ # ## Combine Multiple Images into Unified Creation Seamlessly blend 2-5 images together to create a single unique image that combines elements, styles, and concepts from all source images. ### How it Works Upload 2-5 image URLs and specify an aspect ratio. The API analyzes all images and creates a cohesive blend that merges their visual elements, colors, styles, and concepts. ### Required Parameters - `imgUrls` - Array of 2-5 image URLs to blend - `aspect_ratio` - Output aspect ratio: \"2:3\" (portrait), \"1:1\" (square), or \"3:2\" (landscape) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The blended images (4 variations) will be sent to your callback URL when complete (typically 60-90 seconds). ### Use Cases - Combine style references for unique visual concepts - Merge product photos with artistic styles - Create hybrid concepts from multiple references - Blend textures and patterns for design work - Mix character designs or architectural styles ### Tips - Works best with 2-3 images; more images create more abstract results - All source images should be publicly accessible URLs - The blend is conceptual, not a simple overlay - Consider the aspect ratio based on your intended use - Experiment with different image composition, color palettes, or subject matter for varied results.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :x_api_key
37
+ # @option opts [String] :body
38
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
39
+ def api_v1_blend_post_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_blend_post ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v1/blend'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
60
+
61
+ # return_type
62
+ return_type = opts[:debug_return_type] || 'TaskResponse'
63
+
64
+ # auth_names
65
+ auth_names = opts[:debug_auth_names] || []
66
+
67
+ new_options = opts.merge(
68
+ :operation => :"ImageApi.api_v1_blend_post",
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_blend_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Describe
85
+ # ## Generate Detailed Text Descriptions from Images Analyze an image and generate detailed text descriptions that can be used as prompts for image generation. Perfect for reverse-engineering images or creating prompt variations. ### How it Works Provide an image URL and the API analyzes the image using AI, generating 4 different text descriptions that capture the image's content, style, mood, and composition. ### Required Parameters - `imgUrl` - Public URL of the image to analyze and describe ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The generated descriptions (typically 4 variations) will be sent to your callback URL when complete (typically 30-60 seconds). ### Use Cases - Reverse-engineer successful images to understand prompt styles - Generate prompt variations from reference images - Create training data for prompt engineering - Document image libraries with AI-generated descriptions - Learn effective prompt writing by analyzing AI descriptions ### Tips - Image URL must be publicly accessible - Descriptions can be used directly as prompts for diffusion endpoint - Each description offers a different perspective/focus on the image - Useful for building prompt libraries from visual references - Combine with your own modifications for customized prompts
86
+ # @param [Hash] opts the optional parameters
87
+ # @option opts [String] :x_api_key
88
+ # @option opts [Object] :body
89
+ # @return [TaskResponse]
90
+ def api_v1_describe_post(opts = {})
91
+ data, _status_code, _headers = api_v1_describe_post_with_http_info(opts)
92
+ data
93
+ end
94
+
95
+ # Describe
96
+ # ## Generate Detailed Text Descriptions from Images Analyze an image and generate detailed text descriptions that can be used as prompts for image generation. Perfect for reverse-engineering images or creating prompt variations. ### How it Works Provide an image URL and the API analyzes the image using AI, generating 4 different text descriptions that capture the image&#39;s content, style, mood, and composition. ### Required Parameters - &#x60;imgUrl&#x60; - Public URL of the image to analyze and describe ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The generated descriptions (typically 4 variations) will be sent to your callback URL when complete (typically 30-60 seconds). ### Use Cases - Reverse-engineer successful images to understand prompt styles - Generate prompt variations from reference images - Create training data for prompt engineering - Document image libraries with AI-generated descriptions - Learn effective prompt writing by analyzing AI descriptions ### Tips - Image URL must be publicly accessible - Descriptions can be used directly as prompts for diffusion endpoint - Each description offers a different perspective/focus on the image - Useful for building prompt libraries from visual references - Combine with your own modifications for customized prompts
97
+ # @param [Hash] opts the optional parameters
98
+ # @option opts [String] :x_api_key
99
+ # @option opts [Object] :body
100
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
101
+ def api_v1_describe_post_with_http_info(opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_describe_post ...'
104
+ end
105
+ # resource path
106
+ local_var_path = '/api/v1/describe'
107
+
108
+ # query parameters
109
+ query_params = opts[:query_params] || {}
110
+
111
+ # header parameters
112
+ header_params = opts[:header_params] || {}
113
+ # HTTP header 'Accept' (if needed)
114
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
115
+ # HTTP header 'Content-Type'
116
+ content_type = @api_client.select_header_content_type(['application/json'])
117
+ if !content_type.nil?
118
+ header_params['Content-Type'] = content_type
119
+ end
120
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
127
+
128
+ # return_type
129
+ return_type = opts[:debug_return_type] || 'TaskResponse'
130
+
131
+ # auth_names
132
+ auth_names = opts[:debug_auth_names] || []
133
+
134
+ new_options = opts.merge(
135
+ :operation => :"ImageApi.api_v1_describe_post",
136
+ :header_params => header_params,
137
+ :query_params => query_params,
138
+ :form_params => form_params,
139
+ :body => post_body,
140
+ :auth_names => auth_names,
141
+ :return_type => return_type
142
+ )
143
+
144
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_describe_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+
151
+ # Diffusion
152
+ # ## Generate Image from Text Prompt (Diffusion) Creates AI-generated images from text descriptions using Midjourney's diffusion model. This endpoint processes your prompt asynchronously and delivers the generated image to your specified callback URL. ### How It Works Submit a text prompt describing the image you want to create. The API processes your request using Midjourney's AI model and sends the generated image result to your callback URL when complete. Processing typically takes 30-90 seconds depending on complexity and queue length. ### Required Parameters - **`text`** (string, required) - Your image description prompt - Example: `\"A beautiful sunset over the snow mountains\"` - Supports Midjourney parameters like `--v 7` (model version), `--draft` (draft mode), `--ar 16:9` (aspect ratio) - Be specific and descriptive for best results - **`callback`** (string, required) - HTTPS webhook URL to receive the result - Must be publicly accessible and accept POST requests - Example: `\"https://your-domain.com/webhook/image-result\"` - The API will send the generated image data to this URL when processing completes ### Authentication Requires a valid API key in the `x-api-key` header. Store your API key securely in environment variables and never expose it in client-side code. ### Response Returns immediately with a task ID and status. The actual generated image will be delivered to your callback URL asynchronously once processing completes. ### Common Use Cases - Generate marketing visuals and social media content - Create concept art and design mockups - Produce unique illustrations for articles and presentations - Prototype visual ideas before commissioning custom artwork - Build AI-powered image generation features into your applications ### Tips for Success - **Be specific:** Detailed prompts produce better results (e.g., \"photorealistic mountain landscape at golden hour\" vs \"mountains\") - **Use Midjourney parameters:** Add `--v 7` for the latest model version, `--ar 16:9` for widescreen format - **Test your callback:** Ensure your webhook endpoint is accessible and can handle POST requests before submitting jobs - **Handle async responses:** Implement proper webhook handling to receive and process results - **Monitor task status:** Use the \"Get task response\" endpoint if you need to check job status manually ### Related Endpoints - **Get task response** - Check the status of your generation task - **Variation** - Create variations of a generated image - **Upscale** - Enhance the resolution of generated images - **Reroll** - Generate alternative versions with the same prompt
153
+ # @param [Hash] opts the optional parameters
154
+ # @option opts [String] :x_api_key
155
+ # @option opts [Object] :body
156
+ # @return [ApiV1DiffusionPost200Response]
157
+ def api_v1_diffusion_post(opts = {})
158
+ data, _status_code, _headers = api_v1_diffusion_post_with_http_info(opts)
159
+ data
160
+ end
161
+
162
+ # Diffusion
163
+ # ## Generate Image from Text Prompt (Diffusion) Creates AI-generated images from text descriptions using Midjourney&#39;s diffusion model. This endpoint processes your prompt asynchronously and delivers the generated image to your specified callback URL. ### How It Works Submit a text prompt describing the image you want to create. The API processes your request using Midjourney&#39;s AI model and sends the generated image result to your callback URL when complete. Processing typically takes 30-90 seconds depending on complexity and queue length. ### Required Parameters - **&#x60;text&#x60;** (string, required) - Your image description prompt - Example: &#x60;\&quot;A beautiful sunset over the snow mountains\&quot;&#x60; - Supports Midjourney parameters like &#x60;--v 7&#x60; (model version), &#x60;--draft&#x60; (draft mode), &#x60;--ar 16:9&#x60; (aspect ratio) - Be specific and descriptive for best results - **&#x60;callback&#x60;** (string, required) - HTTPS webhook URL to receive the result - Must be publicly accessible and accept POST requests - Example: &#x60;\&quot;https://your-domain.com/webhook/image-result\&quot;&#x60; - The API will send the generated image data to this URL when processing completes ### Authentication Requires a valid API key in the &#x60;x-api-key&#x60; header. Store your API key securely in environment variables and never expose it in client-side code. ### Response Returns immediately with a task ID and status. The actual generated image will be delivered to your callback URL asynchronously once processing completes. ### Common Use Cases - Generate marketing visuals and social media content - Create concept art and design mockups - Produce unique illustrations for articles and presentations - Prototype visual ideas before commissioning custom artwork - Build AI-powered image generation features into your applications ### Tips for Success - **Be specific:** Detailed prompts produce better results (e.g., \&quot;photorealistic mountain landscape at golden hour\&quot; vs \&quot;mountains\&quot;) - **Use Midjourney parameters:** Add &#x60;--v 7&#x60; for the latest model version, &#x60;--ar 16:9&#x60; for widescreen format - **Test your callback:** Ensure your webhook endpoint is accessible and can handle POST requests before submitting jobs - **Handle async responses:** Implement proper webhook handling to receive and process results - **Monitor task status:** Use the \&quot;Get task response\&quot; endpoint if you need to check job status manually ### Related Endpoints - **Get task response** - Check the status of your generation task - **Variation** - Create variations of a generated image - **Upscale** - Enhance the resolution of generated images - **Reroll** - Generate alternative versions with the same prompt
164
+ # @param [Hash] opts the optional parameters
165
+ # @option opts [String] :x_api_key
166
+ # @option opts [Object] :body
167
+ # @return [Array<(ApiV1DiffusionPost200Response, Integer, Hash)>] ApiV1DiffusionPost200Response data, response status code and response headers
168
+ def api_v1_diffusion_post_with_http_info(opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_diffusion_post ...'
171
+ end
172
+ # resource path
173
+ local_var_path = '/api/v1/diffusion'
174
+
175
+ # query parameters
176
+ query_params = opts[:query_params] || {}
177
+
178
+ # header parameters
179
+ header_params = opts[:header_params] || {}
180
+ # HTTP header 'Accept' (if needed)
181
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
182
+ # HTTP header 'Content-Type'
183
+ content_type = @api_client.select_header_content_type(['application/json'])
184
+ if !content_type.nil?
185
+ header_params['Content-Type'] = content_type
186
+ end
187
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
188
+
189
+ # form parameters
190
+ form_params = opts[:form_params] || {}
191
+
192
+ # http body (model)
193
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
194
+
195
+ # return_type
196
+ return_type = opts[:debug_return_type] || 'ApiV1DiffusionPost200Response'
197
+
198
+ # auth_names
199
+ auth_names = opts[:debug_auth_names] || []
200
+
201
+ new_options = opts.merge(
202
+ :operation => :"ImageApi.api_v1_diffusion_post",
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_diffusion_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+
218
+ # Edit
219
+ # ## Edit Images with Custom Canvas and Positioning Perform advanced image editing by placing an image on a custom canvas with precise positioning control. Enables complex edits, extensions, and compositions. ### How it Works Place a selected image on a custom-sized canvas at specified coordinates. The API fills empty canvas areas with generated content based on your prompt, allowing for flexible composition and extensions. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to edit (0, 1, 2, or 3) - `canvas` - Target canvas dimensions: - `width` - Canvas width in pixels - `height` - Canvas height in pixels - `imgPos` - Image position on canvas: - `width` - Image width in pixels - `height` - Image height in pixels - `x` - Horizontal offset from canvas top-left - `y` - Vertical offset from canvas top-left - `remixPrompt` - Prompt for filling empty canvas areas (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The edited images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Create complex compositions with custom layouts - Extend images asymmetrically in specific directions - Place subjects in entirely new contexts - Generate custom aspect ratios with filled backgrounds - Build complex scenes by positioning and extending images ### Tips - Canvas dimensions define the final output size - imgPos coordinates place your image within the canvas - Empty canvas areas are generated based on remixPrompt - More flexible than pan/outpaint for asymmetric extensions - Useful for precise aspect ratio and positioning control
220
+ # @param [Hash] opts the optional parameters
221
+ # @option opts [String] :x_api_key
222
+ # @option opts [Object] :body
223
+ # @return [ApiV1EditPost200Response]
224
+ def api_v1_edit_post(opts = {})
225
+ data, _status_code, _headers = api_v1_edit_post_with_http_info(opts)
226
+ data
227
+ end
228
+
229
+ # Edit
230
+ # ## Edit Images with Custom Canvas and Positioning Perform advanced image editing by placing an image on a custom canvas with precise positioning control. Enables complex edits, extensions, and compositions. ### How it Works Place a selected image on a custom-sized canvas at specified coordinates. The API fills empty canvas areas with generated content based on your prompt, allowing for flexible composition and extensions. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to edit (0, 1, 2, or 3) - &#x60;canvas&#x60; - Target canvas dimensions: - &#x60;width&#x60; - Canvas width in pixels - &#x60;height&#x60; - Canvas height in pixels - &#x60;imgPos&#x60; - Image position on canvas: - &#x60;width&#x60; - Image width in pixels - &#x60;height&#x60; - Image height in pixels - &#x60;x&#x60; - Horizontal offset from canvas top-left - &#x60;y&#x60; - Vertical offset from canvas top-left - &#x60;remixPrompt&#x60; - Prompt for filling empty canvas areas (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The edited images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Create complex compositions with custom layouts - Extend images asymmetrically in specific directions - Place subjects in entirely new contexts - Generate custom aspect ratios with filled backgrounds - Build complex scenes by positioning and extending images ### Tips - Canvas dimensions define the final output size - imgPos coordinates place your image within the canvas - Empty canvas areas are generated based on remixPrompt - More flexible than pan/outpaint for asymmetric extensions - Useful for precise aspect ratio and positioning control
231
+ # @param [Hash] opts the optional parameters
232
+ # @option opts [String] :x_api_key
233
+ # @option opts [Object] :body
234
+ # @return [Array<(ApiV1EditPost200Response, Integer, Hash)>] ApiV1EditPost200Response data, response status code and response headers
235
+ def api_v1_edit_post_with_http_info(opts = {})
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_edit_post ...'
238
+ end
239
+ # resource path
240
+ local_var_path = '/api/v1/edit'
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
249
+ # HTTP header 'Content-Type'
250
+ content_type = @api_client.select_header_content_type(['application/json'])
251
+ if !content_type.nil?
252
+ header_params['Content-Type'] = content_type
253
+ end
254
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
255
+
256
+ # form parameters
257
+ form_params = opts[:form_params] || {}
258
+
259
+ # http body (model)
260
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
261
+
262
+ # return_type
263
+ return_type = opts[:debug_return_type] || 'ApiV1EditPost200Response'
264
+
265
+ # auth_names
266
+ auth_names = opts[:debug_auth_names] || []
267
+
268
+ new_options = opts.merge(
269
+ :operation => :"ImageApi.api_v1_edit_post",
270
+ :header_params => header_params,
271
+ :query_params => query_params,
272
+ :form_params => form_params,
273
+ :body => post_body,
274
+ :auth_names => auth_names,
275
+ :return_type => return_type
276
+ )
277
+
278
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
279
+ if @api_client.config.debugging
280
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_edit_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
281
+ end
282
+ return data, status_code, headers
283
+ end
284
+
285
+ # Inpaint
286
+ # ## Selectively Modify Image Regions with Masks Repaint or modify specific regions within an existing image using mask-based editing. Target precise areas for changes while preserving the rest of the image. ### How it Works Select an image and define regions to modify using either polygon coordinates or a mask image URL. Optionally provide a prompt to guide what should appear in those regions. The API regenerates only the masked areas. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to edit (0, 1, 2, or 3) - `mask` - Regions to repaint (use either areas array or url): - `areas` - Array of polygons with width, height, and points (XYXY coordinates) - `url` - Black and white mask image URL (white areas will be repainted) - `remixPrompt` - Optional prompt for the repaint area (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The inpainted images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Remove unwanted objects from images - Replace specific elements while keeping surroundings - Modify facial expressions or poses - Change colors or textures in targeted areas - Fix specific issues without regenerating entire image ### Tips - Polygon points format: \\[x1,y1, x2,y2, x3,y3, x4,y4\\] in clockwise order - Mask images: white = repaint, black = keep original - Use remixPrompt to specify what should replace masked content - Smaller masks give more precise control - Can apply multiple polygon areas in a single request
287
+ # @param [Hash] opts the optional parameters
288
+ # @option opts [String] :x_api_key
289
+ # @option opts [Object] :body
290
+ # @return [TaskResponse]
291
+ def api_v1_inpaint_post(opts = {})
292
+ data, _status_code, _headers = api_v1_inpaint_post_with_http_info(opts)
293
+ data
294
+ end
295
+
296
+ # Inpaint
297
+ # ## Selectively Modify Image Regions with Masks Repaint or modify specific regions within an existing image using mask-based editing. Target precise areas for changes while preserving the rest of the image. ### How it Works Select an image and define regions to modify using either polygon coordinates or a mask image URL. Optionally provide a prompt to guide what should appear in those regions. The API regenerates only the masked areas. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to edit (0, 1, 2, or 3) - &#x60;mask&#x60; - Regions to repaint (use either areas array or url): - &#x60;areas&#x60; - Array of polygons with width, height, and points (XYXY coordinates) - &#x60;url&#x60; - Black and white mask image URL (white areas will be repainted) - &#x60;remixPrompt&#x60; - Optional prompt for the repaint area (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The inpainted images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Remove unwanted objects from images - Replace specific elements while keeping surroundings - Modify facial expressions or poses - Change colors or textures in targeted areas - Fix specific issues without regenerating entire image ### Tips - Polygon points format: \\[x1,y1, x2,y2, x3,y3, x4,y4\\] in clockwise order - Mask images: white &#x3D; repaint, black &#x3D; keep original - Use remixPrompt to specify what should replace masked content - Smaller masks give more precise control - Can apply multiple polygon areas in a single request
298
+ # @param [Hash] opts the optional parameters
299
+ # @option opts [String] :x_api_key
300
+ # @option opts [Object] :body
301
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
302
+ def api_v1_inpaint_post_with_http_info(opts = {})
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_inpaint_post ...'
305
+ end
306
+ # resource path
307
+ local_var_path = '/api/v1/inpaint'
308
+
309
+ # query parameters
310
+ query_params = opts[:query_params] || {}
311
+
312
+ # header parameters
313
+ header_params = opts[:header_params] || {}
314
+ # HTTP header 'Accept' (if needed)
315
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
316
+ # HTTP header 'Content-Type'
317
+ content_type = @api_client.select_header_content_type(['application/json'])
318
+ if !content_type.nil?
319
+ header_params['Content-Type'] = content_type
320
+ end
321
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
322
+
323
+ # form parameters
324
+ form_params = opts[:form_params] || {}
325
+
326
+ # http body (model)
327
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
328
+
329
+ # return_type
330
+ return_type = opts[:debug_return_type] || 'TaskResponse'
331
+
332
+ # auth_names
333
+ auth_names = opts[:debug_auth_names] || []
334
+
335
+ new_options = opts.merge(
336
+ :operation => :"ImageApi.api_v1_inpaint_post",
337
+ :header_params => header_params,
338
+ :query_params => query_params,
339
+ :form_params => form_params,
340
+ :body => post_body,
341
+ :auth_names => auth_names,
342
+ :return_type => return_type
343
+ )
344
+
345
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
346
+ if @api_client.config.debugging
347
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_inpaint_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
348
+ end
349
+ return data, status_code, headers
350
+ end
351
+
352
+ # Outpaint
353
+ # ## Expand Images in All Directions Extend an image uniformly in all directions using intelligent outpainting. Creates a larger canvas while maintaining the original image at the center. ### How it Works Select an image and specify scale factor. The API expands the canvas uniformly in all directions and generates new content that naturally continues the scene on all sides. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to expand (0, 1, 2, or 3) - `scale` - Extension scale ratio (1.1 to 2.0, e.g., 1.5 = 50% larger in all directions) - `remixPrompt` - Optional prompt to guide the outpainted areas (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The outpainted images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Add environmental context around subject-focused images - Create wider scenes from cropped compositions - Extend backgrounds for design flexibility - Generate variations with different surrounding content - Prepare images for different aspect ratios ### Tips - Scale range 1.1-2.0 (outpaint is more conservative than pan) - Use remixPrompt to describe desired surrounding content - Great for adding context without losing the original subject - Original image remains intact at center - Compare with pan for directional control vs. uniform expansion
354
+ # @param [Hash] opts the optional parameters
355
+ # @option opts [String] :x_api_key
356
+ # @option opts [Object] :body
357
+ # @return [TaskResponse]
358
+ def api_v1_outpaint_post(opts = {})
359
+ data, _status_code, _headers = api_v1_outpaint_post_with_http_info(opts)
360
+ data
361
+ end
362
+
363
+ # Outpaint
364
+ # ## Expand Images in All Directions Extend an image uniformly in all directions using intelligent outpainting. Creates a larger canvas while maintaining the original image at the center. ### How it Works Select an image and specify scale factor. The API expands the canvas uniformly in all directions and generates new content that naturally continues the scene on all sides. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to expand (0, 1, 2, or 3) - &#x60;scale&#x60; - Extension scale ratio (1.1 to 2.0, e.g., 1.5 &#x3D; 50% larger in all directions) - &#x60;remixPrompt&#x60; - Optional prompt to guide the outpainted areas (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The outpainted images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Add environmental context around subject-focused images - Create wider scenes from cropped compositions - Extend backgrounds for design flexibility - Generate variations with different surrounding content - Prepare images for different aspect ratios ### Tips - Scale range 1.1-2.0 (outpaint is more conservative than pan) - Use remixPrompt to describe desired surrounding content - Great for adding context without losing the original subject - Original image remains intact at center - Compare with pan for directional control vs. uniform expansion
365
+ # @param [Hash] opts the optional parameters
366
+ # @option opts [String] :x_api_key
367
+ # @option opts [Object] :body
368
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
369
+ def api_v1_outpaint_post_with_http_info(opts = {})
370
+ if @api_client.config.debugging
371
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_outpaint_post ...'
372
+ end
373
+ # resource path
374
+ local_var_path = '/api/v1/outpaint'
375
+
376
+ # query parameters
377
+ query_params = opts[:query_params] || {}
378
+
379
+ # header parameters
380
+ header_params = opts[:header_params] || {}
381
+ # HTTP header 'Accept' (if needed)
382
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
383
+ # HTTP header 'Content-Type'
384
+ content_type = @api_client.select_header_content_type(['application/json'])
385
+ if !content_type.nil?
386
+ header_params['Content-Type'] = content_type
387
+ end
388
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
389
+
390
+ # form parameters
391
+ form_params = opts[:form_params] || {}
392
+
393
+ # http body (model)
394
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
395
+
396
+ # return_type
397
+ return_type = opts[:debug_return_type] || 'TaskResponse'
398
+
399
+ # auth_names
400
+ auth_names = opts[:debug_auth_names] || []
401
+
402
+ new_options = opts.merge(
403
+ :operation => :"ImageApi.api_v1_outpaint_post",
404
+ :header_params => header_params,
405
+ :query_params => query_params,
406
+ :form_params => form_params,
407
+ :body => post_body,
408
+ :auth_names => auth_names,
409
+ :return_type => return_type
410
+ )
411
+
412
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
413
+ if @api_client.config.debugging
414
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_outpaint_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
+ end
416
+ return data, status_code, headers
417
+ end
418
+
419
+ # Pan
420
+ # ## Extend Images in Specific Direction Expand an image in a single specified direction (up, down, left, or right) with precision scale control. Generates new content that seamlessly continues the original image. ### How it Works Select an image and specify direction and scale. The API extends the canvas in that direction and generates new content that naturally continues the scene, maintaining style and coherence. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to extend (0, 1, 2, or 3) - `direction` - Extension direction: 0=Down, 1=Right, 2=Up, 3=Left - `scale` - Extension scale ratio (1.1 to 3.0, e.g., 1.5 = 50% larger in that direction) - `remixPrompt` - Optional prompt to guide the extended content (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The extended images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Create wider landscape compositions from square images - Extend portraits to include more environmental context - Add vertical space for text overlays or additional content - Build panoramic views from single images - Adjust aspect ratios for different platform requirements ### Tips - Use remixPrompt to specify what should appear in the extended area - Scale 1.5 is a good starting point (50% extension) - Higher scales (2.0-3.0) create more new content but may lose coherence - Works directionally - use outpaint for all-direction expansion - Can be applied multiple times in different directions
421
+ # @param [Hash] opts the optional parameters
422
+ # @option opts [String] :x_api_key
423
+ # @option opts [Object] :body
424
+ # @return [ApiV1PanPost200Response]
425
+ def api_v1_pan_post(opts = {})
426
+ data, _status_code, _headers = api_v1_pan_post_with_http_info(opts)
427
+ data
428
+ end
429
+
430
+ # Pan
431
+ # ## Extend Images in Specific Direction Expand an image in a single specified direction (up, down, left, or right) with precision scale control. Generates new content that seamlessly continues the original image. ### How it Works Select an image and specify direction and scale. The API extends the canvas in that direction and generates new content that naturally continues the scene, maintaining style and coherence. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to extend (0, 1, 2, or 3) - &#x60;direction&#x60; - Extension direction: 0&#x3D;Down, 1&#x3D;Right, 2&#x3D;Up, 3&#x3D;Left - &#x60;scale&#x60; - Extension scale ratio (1.1 to 3.0, e.g., 1.5 &#x3D; 50% larger in that direction) - &#x60;remixPrompt&#x60; - Optional prompt to guide the extended content (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The extended images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Create wider landscape compositions from square images - Extend portraits to include more environmental context - Add vertical space for text overlays or additional content - Build panoramic views from single images - Adjust aspect ratios for different platform requirements ### Tips - Use remixPrompt to specify what should appear in the extended area - Scale 1.5 is a good starting point (50% extension) - Higher scales (2.0-3.0) create more new content but may lose coherence - Works directionally - use outpaint for all-direction expansion - Can be applied multiple times in different directions
432
+ # @param [Hash] opts the optional parameters
433
+ # @option opts [String] :x_api_key
434
+ # @option opts [Object] :body
435
+ # @return [Array<(ApiV1PanPost200Response, Integer, Hash)>] ApiV1PanPost200Response data, response status code and response headers
436
+ def api_v1_pan_post_with_http_info(opts = {})
437
+ if @api_client.config.debugging
438
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_pan_post ...'
439
+ end
440
+ # resource path
441
+ local_var_path = '/api/v1/pan'
442
+
443
+ # query parameters
444
+ query_params = opts[:query_params] || {}
445
+
446
+ # header parameters
447
+ header_params = opts[:header_params] || {}
448
+ # HTTP header 'Accept' (if needed)
449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
450
+ # HTTP header 'Content-Type'
451
+ content_type = @api_client.select_header_content_type(['application/json'])
452
+ if !content_type.nil?
453
+ header_params['Content-Type'] = content_type
454
+ end
455
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
456
+
457
+ # form parameters
458
+ form_params = opts[:form_params] || {}
459
+
460
+ # http body (model)
461
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
462
+
463
+ # return_type
464
+ return_type = opts[:debug_return_type] || 'ApiV1PanPost200Response'
465
+
466
+ # auth_names
467
+ auth_names = opts[:debug_auth_names] || []
468
+
469
+ new_options = opts.merge(
470
+ :operation => :"ImageApi.api_v1_pan_post",
471
+ :header_params => header_params,
472
+ :query_params => query_params,
473
+ :form_params => form_params,
474
+ :body => post_body,
475
+ :auth_names => auth_names,
476
+ :return_type => return_type
477
+ )
478
+
479
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
480
+ if @api_client.config.debugging
481
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_pan_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
482
+ end
483
+ return data, status_code, headers
484
+ end
485
+
486
+ # Remix
487
+ # ## Transform Images with New Prompts Apply a new text prompt to an existing image, transforming it while maintaining aspects of the original composition. Controllable intensity for subtle or dramatic changes. ### How it Works Select an image and provide a new prompt. The API applies the new description to the existing image, creating variations that blend the original structure with the new concept. Intensity mode controls how strongly the new prompt is applied. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to remix (0, 1, 2, or 3) - `remixPrompt` - New prompt to apply to the image (1-8192 characters) - `mode` - Remix intensity: 0=Strong (significant transformation), 1=Subtle (light transformation) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The remixed images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Change the style or mood of an existing image - Apply different artistic directions to the same composition - Modify time of day, weather, or season in scenes - Transform realistic images to artistic styles (or vice versa) - Iterate on concepts by applying different prompts ### Tips - Mode 0 (Strong) makes dramatic changes while keeping some structure - Mode 1 (Subtle) makes gentle modifications, preserving more of the original - Remix prompt completely replaces the original prompt - Great for style transfer and conceptual variations - Experiment with both modes to find the right balance
488
+ # @param [Hash] opts the optional parameters
489
+ # @option opts [String] :x_api_key
490
+ # @option opts [Object] :body
491
+ # @return [TaskResponse]
492
+ def api_v1_remix_post(opts = {})
493
+ data, _status_code, _headers = api_v1_remix_post_with_http_info(opts)
494
+ data
495
+ end
496
+
497
+ # Remix
498
+ # ## Transform Images with New Prompts Apply a new text prompt to an existing image, transforming it while maintaining aspects of the original composition. Controllable intensity for subtle or dramatic changes. ### How it Works Select an image and provide a new prompt. The API applies the new description to the existing image, creating variations that blend the original structure with the new concept. Intensity mode controls how strongly the new prompt is applied. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to remix (0, 1, 2, or 3) - &#x60;remixPrompt&#x60; - New prompt to apply to the image (1-8192 characters) - &#x60;mode&#x60; - Remix intensity: 0&#x3D;Strong (significant transformation), 1&#x3D;Subtle (light transformation) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The remixed images (4 variations) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Change the style or mood of an existing image - Apply different artistic directions to the same composition - Modify time of day, weather, or season in scenes - Transform realistic images to artistic styles (or vice versa) - Iterate on concepts by applying different prompts ### Tips - Mode 0 (Strong) makes dramatic changes while keeping some structure - Mode 1 (Subtle) makes gentle modifications, preserving more of the original - Remix prompt completely replaces the original prompt - Great for style transfer and conceptual variations - Experiment with both modes to find the right balance
499
+ # @param [Hash] opts the optional parameters
500
+ # @option opts [String] :x_api_key
501
+ # @option opts [Object] :body
502
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
503
+ def api_v1_remix_post_with_http_info(opts = {})
504
+ if @api_client.config.debugging
505
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_remix_post ...'
506
+ end
507
+ # resource path
508
+ local_var_path = '/api/v1/remix'
509
+
510
+ # query parameters
511
+ query_params = opts[:query_params] || {}
512
+
513
+ # header parameters
514
+ header_params = opts[:header_params] || {}
515
+ # HTTP header 'Accept' (if needed)
516
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
517
+ # HTTP header 'Content-Type'
518
+ content_type = @api_client.select_header_content_type(['application/json'])
519
+ if !content_type.nil?
520
+ header_params['Content-Type'] = content_type
521
+ end
522
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
523
+
524
+ # form parameters
525
+ form_params = opts[:form_params] || {}
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type] || 'TaskResponse'
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || []
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"ImageApi.api_v1_remix_post",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_remix_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+
553
+ # Reroll
554
+ # ## Re-execute Task with Same Parameters Regenerate a new set of images using the exact same parameters as a previous task. This is equivalent to running the original request again with identical settings. ### How it Works Provide a previous task's job ID and the API will execute the same generation with the same prompt and parameters, producing 4 completely new variations. ### Required Parameters - `jobId` - UUID of the task to reroll ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a new task object with different `job_id`. The rerolled images (4 new variations) will be sent to your callback URL when complete (typically 60-90 seconds). ### Use Cases - Try the same prompt again if initial results didn't meet expectations - Generate additional variations without retyping prompts - Explore different random seeds for the same concept - Create more options from successful prompts ### Tips - Reroll uses the exact same parameters as the original task - Results will be completely different due to different random seeds - Consider using variation endpoint instead if you want to build on a specific result - You can reroll any completed task, even from previous sessions
555
+ # @param [Hash] opts the optional parameters
556
+ # @option opts [String] :x_api_key
557
+ # @option opts [Object] :body
558
+ # @return [TaskResponse]
559
+ def api_v1_reroll_post(opts = {})
560
+ data, _status_code, _headers = api_v1_reroll_post_with_http_info(opts)
561
+ data
562
+ end
563
+
564
+ # Reroll
565
+ # ## Re-execute Task with Same Parameters Regenerate a new set of images using the exact same parameters as a previous task. This is equivalent to running the original request again with identical settings. ### How it Works Provide a previous task&#39;s job ID and the API will execute the same generation with the same prompt and parameters, producing 4 completely new variations. ### Required Parameters - &#x60;jobId&#x60; - UUID of the task to reroll ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a new task object with different &#x60;job_id&#x60;. The rerolled images (4 new variations) will be sent to your callback URL when complete (typically 60-90 seconds). ### Use Cases - Try the same prompt again if initial results didn&#39;t meet expectations - Generate additional variations without retyping prompts - Explore different random seeds for the same concept - Create more options from successful prompts ### Tips - Reroll uses the exact same parameters as the original task - Results will be completely different due to different random seeds - Consider using variation endpoint instead if you want to build on a specific result - You can reroll any completed task, even from previous sessions
566
+ # @param [Hash] opts the optional parameters
567
+ # @option opts [String] :x_api_key
568
+ # @option opts [Object] :body
569
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
570
+ def api_v1_reroll_post_with_http_info(opts = {})
571
+ if @api_client.config.debugging
572
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_reroll_post ...'
573
+ end
574
+ # resource path
575
+ local_var_path = '/api/v1/reroll'
576
+
577
+ # query parameters
578
+ query_params = opts[:query_params] || {}
579
+
580
+ # header parameters
581
+ header_params = opts[:header_params] || {}
582
+ # HTTP header 'Accept' (if needed)
583
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
584
+ # HTTP header 'Content-Type'
585
+ content_type = @api_client.select_header_content_type(['application/json'])
586
+ if !content_type.nil?
587
+ header_params['Content-Type'] = content_type
588
+ end
589
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
590
+
591
+ # form parameters
592
+ form_params = opts[:form_params] || {}
593
+
594
+ # http body (model)
595
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
596
+
597
+ # return_type
598
+ return_type = opts[:debug_return_type] || 'TaskResponse'
599
+
600
+ # auth_names
601
+ auth_names = opts[:debug_auth_names] || []
602
+
603
+ new_options = opts.merge(
604
+ :operation => :"ImageApi.api_v1_reroll_post",
605
+ :header_params => header_params,
606
+ :query_params => query_params,
607
+ :form_params => form_params,
608
+ :body => post_body,
609
+ :auth_names => auth_names,
610
+ :return_type => return_type
611
+ )
612
+
613
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
614
+ if @api_client.config.debugging
615
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_reroll_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
616
+ end
617
+ return data, status_code, headers
618
+ end
619
+
620
+ # Shorten
621
+ # ## Simplify Prompts to Essential Elements Analyze a long or complex prompt and reduce it to its most essential and impactful elements, maintaining effectiveness while improving clarity. ### How it Works Submit a lengthy prompt and the API analyzes it using AI, identifying the most important elements and removing redundancy. Returns multiple shortened variations. ### Required Parameters - `prompt` - The text prompt to simplify (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The shortened prompt variations will be sent to your callback URL when complete (typically 20-40 seconds). ### Use Cases - Optimize overly verbose prompts for better results - Learn which prompt elements are most impactful - Reduce token usage in prompt-based workflows - Clean up accumulated prompt modifications - Simplify complex prompts for better model understanding ### Tips - Particularly useful for prompts over 100 words - The AI preserves key descriptive elements while removing filler - Multiple variations help you choose the best simplified version - Test both original and shortened prompts to compare results - Great for learning concise prompt writing techniques
622
+ # @param [Hash] opts the optional parameters
623
+ # @option opts [String] :x_api_key
624
+ # @option opts [Object] :body
625
+ # @return [TaskResponse]
626
+ def api_v1_shorten_post(opts = {})
627
+ data, _status_code, _headers = api_v1_shorten_post_with_http_info(opts)
628
+ data
629
+ end
630
+
631
+ # Shorten
632
+ # ## Simplify Prompts to Essential Elements Analyze a long or complex prompt and reduce it to its most essential and impactful elements, maintaining effectiveness while improving clarity. ### How it Works Submit a lengthy prompt and the API analyzes it using AI, identifying the most important elements and removing redundancy. Returns multiple shortened variations. ### Required Parameters - &#x60;prompt&#x60; - The text prompt to simplify (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The shortened prompt variations will be sent to your callback URL when complete (typically 20-40 seconds). ### Use Cases - Optimize overly verbose prompts for better results - Learn which prompt elements are most impactful - Reduce token usage in prompt-based workflows - Clean up accumulated prompt modifications - Simplify complex prompts for better model understanding ### Tips - Particularly useful for prompts over 100 words - The AI preserves key descriptive elements while removing filler - Multiple variations help you choose the best simplified version - Test both original and shortened prompts to compare results - Great for learning concise prompt writing techniques
633
+ # @param [Hash] opts the optional parameters
634
+ # @option opts [String] :x_api_key
635
+ # @option opts [Object] :body
636
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
637
+ def api_v1_shorten_post_with_http_info(opts = {})
638
+ if @api_client.config.debugging
639
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_shorten_post ...'
640
+ end
641
+ # resource path
642
+ local_var_path = '/api/v1/shorten'
643
+
644
+ # query parameters
645
+ query_params = opts[:query_params] || {}
646
+
647
+ # header parameters
648
+ header_params = opts[:header_params] || {}
649
+ # HTTP header 'Accept' (if needed)
650
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
651
+ # HTTP header 'Content-Type'
652
+ content_type = @api_client.select_header_content_type(['application/json'])
653
+ if !content_type.nil?
654
+ header_params['Content-Type'] = content_type
655
+ end
656
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
657
+
658
+ # form parameters
659
+ form_params = opts[:form_params] || {}
660
+
661
+ # http body (model)
662
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
663
+
664
+ # return_type
665
+ return_type = opts[:debug_return_type] || 'TaskResponse'
666
+
667
+ # auth_names
668
+ auth_names = opts[:debug_auth_names] || []
669
+
670
+ new_options = opts.merge(
671
+ :operation => :"ImageApi.api_v1_shorten_post",
672
+ :header_params => header_params,
673
+ :query_params => query_params,
674
+ :form_params => form_params,
675
+ :body => post_body,
676
+ :auth_names => auth_names,
677
+ :return_type => return_type
678
+ )
679
+
680
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
681
+ if @api_client.config.debugging
682
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_shorten_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
683
+ end
684
+ return data, status_code, headers
685
+ end
686
+
687
+ # Upscale
688
+ # ## Enhance Image Resolution and Quality Upscale and enhance one of your generated images to higher resolution with AI-powered quality improvement. Produces a single high-resolution version of the selected image. ### How it Works Select one image from a generation task and choose upscaling type. The API processes the image to increase resolution while adding detail and clarity based on the selected upscaling mode. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to upscale (0, 1, 2, or 3) - `type` - Upscaling type: 0=Subtle (conservative enhancement), 1=Creative (adds detail and interpretation) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The upscaled image (single high-resolution output) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Prepare images for print or high-resolution displays - Enhance selected variations for final delivery - Create detailed versions for client presentations - Generate production-ready assets from generations ### Tips - Type 0 (Subtle) is safer for preserving exact details - Type 1 (Creative) works well for artistic images where added interpretation is acceptable - Upscaling is typically the final step after selecting your preferred variation - Output resolution is significantly higher than the original 4-image grid
689
+ # @param [Hash] opts the optional parameters
690
+ # @option opts [String] :x_api_key
691
+ # @option opts [Object] :body
692
+ # @return [TaskResponse]
693
+ def api_v1_upscale_post(opts = {})
694
+ data, _status_code, _headers = api_v1_upscale_post_with_http_info(opts)
695
+ data
696
+ end
697
+
698
+ # Upscale
699
+ # ## Enhance Image Resolution and Quality Upscale and enhance one of your generated images to higher resolution with AI-powered quality improvement. Produces a single high-resolution version of the selected image. ### How it Works Select one image from a generation task and choose upscaling type. The API processes the image to increase resolution while adding detail and clarity based on the selected upscaling mode. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to upscale (0, 1, 2, or 3) - &#x60;type&#x60; - Upscaling type: 0&#x3D;Subtle (conservative enhancement), 1&#x3D;Creative (adds detail and interpretation) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a task object. The upscaled image (single high-resolution output) will be sent to your callback URL when complete (typically 90-120 seconds). ### Use Cases - Prepare images for print or high-resolution displays - Enhance selected variations for final delivery - Create detailed versions for client presentations - Generate production-ready assets from generations ### Tips - Type 0 (Subtle) is safer for preserving exact details - Type 1 (Creative) works well for artistic images where added interpretation is acceptable - Upscaling is typically the final step after selecting your preferred variation - Output resolution is significantly higher than the original 4-image grid
700
+ # @param [Hash] opts the optional parameters
701
+ # @option opts [String] :x_api_key
702
+ # @option opts [Object] :body
703
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
704
+ def api_v1_upscale_post_with_http_info(opts = {})
705
+ if @api_client.config.debugging
706
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_upscale_post ...'
707
+ end
708
+ # resource path
709
+ local_var_path = '/api/v1/upscale'
710
+
711
+ # query parameters
712
+ query_params = opts[:query_params] || {}
713
+
714
+ # header parameters
715
+ header_params = opts[:header_params] || {}
716
+ # HTTP header 'Accept' (if needed)
717
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
718
+ # HTTP header 'Content-Type'
719
+ content_type = @api_client.select_header_content_type(['application/json'])
720
+ if !content_type.nil?
721
+ header_params['Content-Type'] = content_type
722
+ end
723
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
724
+
725
+ # form parameters
726
+ form_params = opts[:form_params] || {}
727
+
728
+ # http body (model)
729
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
730
+
731
+ # return_type
732
+ return_type = opts[:debug_return_type] || 'TaskResponse'
733
+
734
+ # auth_names
735
+ auth_names = opts[:debug_auth_names] || []
736
+
737
+ new_options = opts.merge(
738
+ :operation => :"ImageApi.api_v1_upscale_post",
739
+ :header_params => header_params,
740
+ :query_params => query_params,
741
+ :form_params => form_params,
742
+ :body => post_body,
743
+ :auth_names => auth_names,
744
+ :return_type => return_type
745
+ )
746
+
747
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
748
+ if @api_client.config.debugging
749
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_upscale_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
750
+ end
751
+ return data, status_code, headers
752
+ end
753
+
754
+ # Variation
755
+ # ## Create Controlled Variations of Existing Images Generate new variations of a specific image from a previous generation task with controllable transformation intensity. Perfect for exploring different interpretations while maintaining the core composition. ### How it Works Select one of the 4 generated images from a diffusion task and create variations with either subtle or strong intensity. The API generates 4 new variations based on your selected image and intensity setting. ### Required Parameters - `jobId` - UUID of the original image generation task - `imageNo` - Image number to vary (0, 1, 2, or 3) - `type` - Variation intensity: 0=Subtle (minor changes), 1=Strong (major changes) - `remixPrompt` - Optional additional prompt for guided variation (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a new task object with `job_id`. The 4 variation images will be sent to your callback URL when processing completes (typically 60-90 seconds). ### Use Cases - Explore different interpretations of a successful generation - Fine-tune specific aspects of an image - Create multiple versions for A/B testing - Generate variations for client review - Remix images with additional prompt guidance ### Tips - Use type=0 (subtle) for minor refinements, type=1 (strong) for significant changes - Add remixPrompt to guide the variation in a specific direction - The original composition and structure are generally preserved - Can chain variations: create variations of variations for iterative refinement
756
+ # @param [Hash] opts the optional parameters
757
+ # @option opts [String] :x_api_key
758
+ # @option opts [Object] :body
759
+ # @return [TaskResponse]
760
+ def api_v1_variation_post(opts = {})
761
+ data, _status_code, _headers = api_v1_variation_post_with_http_info(opts)
762
+ data
763
+ end
764
+
765
+ # Variation
766
+ # ## Create Controlled Variations of Existing Images Generate new variations of a specific image from a previous generation task with controllable transformation intensity. Perfect for exploring different interpretations while maintaining the core composition. ### How it Works Select one of the 4 generated images from a diffusion task and create variations with either subtle or strong intensity. The API generates 4 new variations based on your selected image and intensity setting. ### Required Parameters - &#x60;jobId&#x60; - UUID of the original image generation task - &#x60;imageNo&#x60; - Image number to vary (0, 1, 2, or 3) - &#x60;type&#x60; - Variation intensity: 0&#x3D;Subtle (minor changes), 1&#x3D;Strong (major changes) - &#x60;remixPrompt&#x60; - Optional additional prompt for guided variation (1-8192 characters) ### Authentication Requires a valid API key passed in the &#x60;x-api-key&#x60; header. ### Response Returns a new task object with &#x60;job_id&#x60;. The 4 variation images will be sent to your callback URL when processing completes (typically 60-90 seconds). ### Use Cases - Explore different interpretations of a successful generation - Fine-tune specific aspects of an image - Create multiple versions for A/B testing - Generate variations for client review - Remix images with additional prompt guidance ### Tips - Use type&#x3D;0 (subtle) for minor refinements, type&#x3D;1 (strong) for significant changes - Add remixPrompt to guide the variation in a specific direction - The original composition and structure are generally preserved - Can chain variations: create variations of variations for iterative refinement
767
+ # @param [Hash] opts the optional parameters
768
+ # @option opts [String] :x_api_key
769
+ # @option opts [Object] :body
770
+ # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
771
+ def api_v1_variation_post_with_http_info(opts = {})
772
+ if @api_client.config.debugging
773
+ @api_client.config.logger.debug 'Calling API: ImageApi.api_v1_variation_post ...'
774
+ end
775
+ # resource path
776
+ local_var_path = '/api/v1/variation'
777
+
778
+ # query parameters
779
+ query_params = opts[:query_params] || {}
780
+
781
+ # header parameters
782
+ header_params = opts[:header_params] || {}
783
+ # HTTP header 'Accept' (if needed)
784
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
785
+ # HTTP header 'Content-Type'
786
+ content_type = @api_client.select_header_content_type(['application/json'])
787
+ if !content_type.nil?
788
+ header_params['Content-Type'] = content_type
789
+ end
790
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
791
+
792
+ # form parameters
793
+ form_params = opts[:form_params] || {}
794
+
795
+ # http body (model)
796
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
797
+
798
+ # return_type
799
+ return_type = opts[:debug_return_type] || 'TaskResponse'
800
+
801
+ # auth_names
802
+ auth_names = opts[:debug_auth_names] || []
803
+
804
+ new_options = opts.merge(
805
+ :operation => :"ImageApi.api_v1_variation_post",
806
+ :header_params => header_params,
807
+ :query_params => query_params,
808
+ :form_params => form_params,
809
+ :body => post_body,
810
+ :auth_names => auth_names,
811
+ :return_type => return_type
812
+ )
813
+
814
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
815
+ if @api_client.config.debugging
816
+ @api_client.config.logger.debug "API called: ImageApi#api_v1_variation_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
817
+ end
818
+ return data, status_code, headers
819
+ end
820
+ end
821
+ end