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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +129 -0
- data/lib/openapi_client/api/account_management_api.rb +82 -0
- data/lib/openapi_client/api/image_api.rb +821 -0
- data/lib/openapi_client/api/video_api.rb +289 -0
- data/lib/openapi_client/api_client.rb +396 -0
- data/lib/openapi_client/api_error.rb +58 -0
- data/lib/openapi_client/api_model_base.rb +88 -0
- data/lib/openapi_client/configuration.rb +301 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response.rb +205 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response_config.rb +156 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config.rb +156 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta.rb +156 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta_usage.rb +165 -0
- data/lib/openapi_client/models/api_v1_diffusion_post200_response_output.rb +168 -0
- data/lib/openapi_client/models/api_v1_edit_post200_response.rb +205 -0
- data/lib/openapi_client/models/api_v1_job_job_id_get200_response.rb +246 -0
- data/lib/openapi_client/models/api_v1_job_job_id_get200_response_error.rb +175 -0
- data/lib/openapi_client/models/api_v1_job_job_id_get200_response_meta.rb +174 -0
- data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output.rb +177 -0
- data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions.rb +224 -0
- data/lib/openapi_client/models/api_v1_pan_post200_response.rb +205 -0
- data/lib/openapi_client/models/balance_response.rb +167 -0
- data/lib/openapi_client/models/balance_response_data.rb +208 -0
- data/lib/openapi_client/models/task_response.rb +206 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +59 -0
- metadata +115 -0
|
@@ -0,0 +1,289 @@
|
|
|
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 VideoApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Extend Video
|
|
23
|
+
# ## Extend Video Duration with Seamless Continuation Add additional frames to extend the duration of generated videos. Creates smooth continuations that seamlessly flow from the original video. ### How it Works Select a previously generated video and optionally provide a prompt to guide the extension. The API analyzes the video's motion and content, then generates additional frames that naturally continue the sequence. Each extension adds 4 seconds. ### Required Parameters - `jobId` - UUID of the original video generation task - `videoNo` - Video number to extend (0, 1, 2, or 3) - `prompt` - Optional prompt to guide the extension (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The extended video will be sent to your callback URL when complete (typically 3-5 minutes). ### Use Cases - Create longer videos from initial 4-second generations - Extend successful animations for more content - Build sequential video narratives - Generate longer social media content - Create extended motion sequences ### Tips - Each extension adds 4 seconds to the video - Can extend up to 4 times (maximum 20 seconds total: 4+4+4+4+4) - Prompt helps guide what happens in the extended portion - Extension quality depends on the source video's clarity and motion - Works with both text-generated and image-animated videos
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :x_api_key
|
|
26
|
+
# @option opts [Object] :body
|
|
27
|
+
# @return [TaskResponse]
|
|
28
|
+
def api_v1_extend_video_post(opts = {})
|
|
29
|
+
data, _status_code, _headers = api_v1_extend_video_post_with_http_info(opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Extend Video
|
|
34
|
+
# ## Extend Video Duration with Seamless Continuation Add additional frames to extend the duration of generated videos. Creates smooth continuations that seamlessly flow from the original video. ### How it Works Select a previously generated video and optionally provide a prompt to guide the extension. The API analyzes the video's motion and content, then generates additional frames that naturally continue the sequence. Each extension adds 4 seconds. ### Required Parameters - `jobId` - UUID of the original video generation task - `videoNo` - Video number to extend (0, 1, 2, or 3) - `prompt` - Optional prompt to guide the extension (1-8192 characters) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The extended video will be sent to your callback URL when complete (typically 3-5 minutes). ### Use Cases - Create longer videos from initial 4-second generations - Extend successful animations for more content - Build sequential video narratives - Generate longer social media content - Create extended motion sequences ### Tips - Each extension adds 4 seconds to the video - Can extend up to 4 times (maximum 20 seconds total: 4+4+4+4+4) - Prompt helps guide what happens in the extended portion - Extension quality depends on the source video's clarity and motion - Works with both text-generated and image-animated videos
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @option opts [String] :x_api_key
|
|
37
|
+
# @option opts [Object] :body
|
|
38
|
+
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
39
|
+
def api_v1_extend_video_post_with_http_info(opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: VideoApi.api_v1_extend_video_post ...'
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/api/v1/extend-video'
|
|
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
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
|
|
59
|
+
|
|
60
|
+
# form parameters
|
|
61
|
+
form_params = opts[:form_params] || {}
|
|
62
|
+
|
|
63
|
+
# http body (model)
|
|
64
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
|
65
|
+
|
|
66
|
+
# return_type
|
|
67
|
+
return_type = opts[:debug_return_type] || 'TaskResponse'
|
|
68
|
+
|
|
69
|
+
# auth_names
|
|
70
|
+
auth_names = opts[:debug_auth_names] || []
|
|
71
|
+
|
|
72
|
+
new_options = opts.merge(
|
|
73
|
+
:operation => :"VideoApi.api_v1_extend_video_post",
|
|
74
|
+
:header_params => header_params,
|
|
75
|
+
:query_params => query_params,
|
|
76
|
+
:form_params => form_params,
|
|
77
|
+
:body => post_body,
|
|
78
|
+
:auth_names => auth_names,
|
|
79
|
+
:return_type => return_type
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
83
|
+
if @api_client.config.debugging
|
|
84
|
+
@api_client.config.logger.debug "API called: VideoApi#api_v1_extend_video_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
85
|
+
end
|
|
86
|
+
return data, status_code, headers
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Get task response
|
|
90
|
+
# ## Retrieve Job Status and Results Query the status and results of any task using its job ID. Use this to check progress, retrieve completed results, or diagnose failures. ### How it Works Provide a job ID from any previous API request. The API returns the current task status, progress information, and results (if completed). Poll this endpoint to track long-running tasks. ### Required Parameters - `job_id` - UUID of the task (passed in URL path) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns complete task information including: - `status` - Current status: pending, staged, processing, failed, or completed - `output` - Generated images/videos (null until completed) - `meta` - Timestamps, usage information, processing details - `error` - Error details if status is \"failed\" - `logs` - Processing logs and progress updates ### Status Values - **pending**: Task queued, waiting to start - **staged**: Task prepared, about to begin processing - **processing**: Actively generating (includes progress percentage in logs) - **completed**: Successfully finished, results available in output field - **failed**: Processing failed, check error field for details ### Use Cases - Poll for task completion if not using webhooks - Retrieve results for tasks completed days/weeks ago - Debug failed tasks by examining error messages - Monitor processing progress for long-running jobs - Retrieve task history and usage information ### Tips - Job IDs are permanent - tasks can be retrieved anytime - Poll every 10-30 seconds for pending tasks (avoid excessive polling) - Webhook callbacks are more efficient than polling - Failed tasks include detailed error messages for debugging - Completed tasks retain all generation parameters in the input field
|
|
91
|
+
# @param job_id [String]
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @option opts [String] :x_api_key
|
|
94
|
+
# @return [ApiV1JobJobIdGet200Response]
|
|
95
|
+
def api_v1_job_job_id_get(job_id, opts = {})
|
|
96
|
+
data, _status_code, _headers = api_v1_job_job_id_get_with_http_info(job_id, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Get task response
|
|
101
|
+
# ## Retrieve Job Status and Results Query the status and results of any task using its job ID. Use this to check progress, retrieve completed results, or diagnose failures. ### How it Works Provide a job ID from any previous API request. The API returns the current task status, progress information, and results (if completed). Poll this endpoint to track long-running tasks. ### Required Parameters - `job_id` - UUID of the task (passed in URL path) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns complete task information including: - `status` - Current status: pending, staged, processing, failed, or completed - `output` - Generated images/videos (null until completed) - `meta` - Timestamps, usage information, processing details - `error` - Error details if status is \"failed\" - `logs` - Processing logs and progress updates ### Status Values - **pending**: Task queued, waiting to start - **staged**: Task prepared, about to begin processing - **processing**: Actively generating (includes progress percentage in logs) - **completed**: Successfully finished, results available in output field - **failed**: Processing failed, check error field for details ### Use Cases - Poll for task completion if not using webhooks - Retrieve results for tasks completed days/weeks ago - Debug failed tasks by examining error messages - Monitor processing progress for long-running jobs - Retrieve task history and usage information ### Tips - Job IDs are permanent - tasks can be retrieved anytime - Poll every 10-30 seconds for pending tasks (avoid excessive polling) - Webhook callbacks are more efficient than polling - Failed tasks include detailed error messages for debugging - Completed tasks retain all generation parameters in the input field
|
|
102
|
+
# @param job_id [String]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [String] :x_api_key
|
|
105
|
+
# @return [Array<(ApiV1JobJobIdGet200Response, Integer, Hash)>] ApiV1JobJobIdGet200Response data, response status code and response headers
|
|
106
|
+
def api_v1_job_job_id_get_with_http_info(job_id, opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: VideoApi.api_v1_job_job_id_get ...'
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'job_id' is set
|
|
111
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling VideoApi.api_v1_job_job_id_get"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/api/v1/job/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
|
|
120
|
+
# header parameters
|
|
121
|
+
header_params = opts[:header_params] || {}
|
|
122
|
+
# HTTP header 'Accept' (if needed)
|
|
123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
124
|
+
header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
|
|
125
|
+
|
|
126
|
+
# form parameters
|
|
127
|
+
form_params = opts[:form_params] || {}
|
|
128
|
+
|
|
129
|
+
# http body (model)
|
|
130
|
+
post_body = opts[:debug_body]
|
|
131
|
+
|
|
132
|
+
# return_type
|
|
133
|
+
return_type = opts[:debug_return_type] || 'ApiV1JobJobIdGet200Response'
|
|
134
|
+
|
|
135
|
+
# auth_names
|
|
136
|
+
auth_names = opts[:debug_auth_names] || []
|
|
137
|
+
|
|
138
|
+
new_options = opts.merge(
|
|
139
|
+
:operation => :"VideoApi.api_v1_job_job_id_get",
|
|
140
|
+
:header_params => header_params,
|
|
141
|
+
:query_params => query_params,
|
|
142
|
+
:form_params => form_params,
|
|
143
|
+
:body => post_body,
|
|
144
|
+
:auth_names => auth_names,
|
|
145
|
+
:return_type => return_type
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
149
|
+
if @api_client.config.debugging
|
|
150
|
+
@api_client.config.logger.debug "API called: VideoApi#api_v1_job_job_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
151
|
+
end
|
|
152
|
+
return data, status_code, headers
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Video Diffusion
|
|
156
|
+
# ## Generate Videos from Text or Animate Images Create dynamic videos either from text prompts or by animating existing generated images. Supports two modes: prompt-based generation and image-to-video animation. ### How it Works **Mode 1 - Text to Video**: Provide a text prompt and the API generates a video based on the description. **Mode 2 - Image to Video**: Select a previously generated image and optionally add a prompt. The API animates the image, bringing it to life with motion. Processing takes 3-5 minutes depending on quality settings. Videos are 4 seconds long. ### Required Parameters **For Text Mode**: - `prompt` - Video generation prompt (1-8192 characters) - `videoType` - Quality: 0=480p (faster), 1=720p (higher quality) **For Image Animation Mode**: - `jobId` - UUID of source image generation task - `imageNo` - Image number to animate (0, 1, 2, or 3) - `prompt` - Optional prompt to guide animation (1-8192 characters) - `videoType` - Quality: 0=480p (faster), 1=720p (higher quality) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The generated videos (4 variations) will be sent to your callback URL when complete (typically 3-5 minutes). ### Use Cases - Create animated content from text descriptions - Bring static generated images to life with animation - Generate video content for social media - Create motion graphics and animated sequences - Produce video mockups and previews ### Tips - 720p quality takes longer but provides significantly better results - Image animation mode adds motion to existing images - 4-second duration is standard - use extend-video to lengthen - Prompt in image mode guides animation style and movement - Text mode generates both visual content and motion
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @option opts [String] :x_api_key
|
|
159
|
+
# @option opts [Object] :body
|
|
160
|
+
# @return [TaskResponse]
|
|
161
|
+
def api_v1_video_diffusion_post(opts = {})
|
|
162
|
+
data, _status_code, _headers = api_v1_video_diffusion_post_with_http_info(opts)
|
|
163
|
+
data
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Video Diffusion
|
|
167
|
+
# ## Generate Videos from Text or Animate Images Create dynamic videos either from text prompts or by animating existing generated images. Supports two modes: prompt-based generation and image-to-video animation. ### How it Works **Mode 1 - Text to Video**: Provide a text prompt and the API generates a video based on the description. **Mode 2 - Image to Video**: Select a previously generated image and optionally add a prompt. The API animates the image, bringing it to life with motion. Processing takes 3-5 minutes depending on quality settings. Videos are 4 seconds long. ### Required Parameters **For Text Mode**: - `prompt` - Video generation prompt (1-8192 characters) - `videoType` - Quality: 0=480p (faster), 1=720p (higher quality) **For Image Animation Mode**: - `jobId` - UUID of source image generation task - `imageNo` - Image number to animate (0, 1, 2, or 3) - `prompt` - Optional prompt to guide animation (1-8192 characters) - `videoType` - Quality: 0=480p (faster), 1=720p (higher quality) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The generated videos (4 variations) will be sent to your callback URL when complete (typically 3-5 minutes). ### Use Cases - Create animated content from text descriptions - Bring static generated images to life with animation - Generate video content for social media - Create motion graphics and animated sequences - Produce video mockups and previews ### Tips - 720p quality takes longer but provides significantly better results - Image animation mode adds motion to existing images - 4-second duration is standard - use extend-video to lengthen - Prompt in image mode guides animation style and movement - Text mode generates both visual content and motion
|
|
168
|
+
# @param [Hash] opts the optional parameters
|
|
169
|
+
# @option opts [String] :x_api_key
|
|
170
|
+
# @option opts [Object] :body
|
|
171
|
+
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
172
|
+
def api_v1_video_diffusion_post_with_http_info(opts = {})
|
|
173
|
+
if @api_client.config.debugging
|
|
174
|
+
@api_client.config.logger.debug 'Calling API: VideoApi.api_v1_video_diffusion_post ...'
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/api/v1/video-diffusion'
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
186
|
+
# HTTP header 'Content-Type'
|
|
187
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
188
|
+
if !content_type.nil?
|
|
189
|
+
header_params['Content-Type'] = content_type
|
|
190
|
+
end
|
|
191
|
+
header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
|
|
192
|
+
|
|
193
|
+
# form parameters
|
|
194
|
+
form_params = opts[:form_params] || {}
|
|
195
|
+
|
|
196
|
+
# http body (model)
|
|
197
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
|
198
|
+
|
|
199
|
+
# return_type
|
|
200
|
+
return_type = opts[:debug_return_type] || 'TaskResponse'
|
|
201
|
+
|
|
202
|
+
# auth_names
|
|
203
|
+
auth_names = opts[:debug_auth_names] || []
|
|
204
|
+
|
|
205
|
+
new_options = opts.merge(
|
|
206
|
+
:operation => :"VideoApi.api_v1_video_diffusion_post",
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: VideoApi#api_v1_video_diffusion_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
return data, status_code, headers
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Video Upscale
|
|
223
|
+
# ## Enhance Video Resolution and Quality Upscale generated videos to higher resolution with AI-powered quality enhancement. Improves clarity, detail, and overall visual quality. ### How it Works Select a previously generated video and the API processes each frame to increase resolution and enhance quality while maintaining motion smoothness and temporal consistency. ### Required Parameters - `jobId` - UUID of the original video generation task - `videoNo` - Video number to upscale (0, 1, 2, or 3) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The upscaled video will be sent to your callback URL when complete (typically 4-6 minutes). ### Use Cases - Prepare videos for high-resolution displays - Enhance quality of draft-quality generations - Create production-ready video assets - Improve detail and clarity for professional use - Upgrade videos for client presentations ### Tips - Significantly increases processing time due to frame-by-frame enhancement - Best applied after you've selected your preferred video variation - Cannot be reversed - always keep original lower-resolution version - Quality improvement is substantial for text clarity and fine details - Consider workflow: generate/extend first, upscale final selection
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @option opts [String] :x_api_key
|
|
226
|
+
# @option opts [Object] :body
|
|
227
|
+
# @return [TaskResponse]
|
|
228
|
+
def api_v1_video_upscale_post(opts = {})
|
|
229
|
+
data, _status_code, _headers = api_v1_video_upscale_post_with_http_info(opts)
|
|
230
|
+
data
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Video Upscale
|
|
234
|
+
# ## Enhance Video Resolution and Quality Upscale generated videos to higher resolution with AI-powered quality enhancement. Improves clarity, detail, and overall visual quality. ### How it Works Select a previously generated video and the API processes each frame to increase resolution and enhance quality while maintaining motion smoothness and temporal consistency. ### Required Parameters - `jobId` - UUID of the original video generation task - `videoNo` - Video number to upscale (0, 1, 2, or 3) ### Authentication Requires a valid API key passed in the `x-api-key` header. ### Response Returns a task object. The upscaled video will be sent to your callback URL when complete (typically 4-6 minutes). ### Use Cases - Prepare videos for high-resolution displays - Enhance quality of draft-quality generations - Create production-ready video assets - Improve detail and clarity for professional use - Upgrade videos for client presentations ### Tips - Significantly increases processing time due to frame-by-frame enhancement - Best applied after you've selected your preferred video variation - Cannot be reversed - always keep original lower-resolution version - Quality improvement is substantial for text clarity and fine details - Consider workflow: generate/extend first, upscale final selection
|
|
235
|
+
# @param [Hash] opts the optional parameters
|
|
236
|
+
# @option opts [String] :x_api_key
|
|
237
|
+
# @option opts [Object] :body
|
|
238
|
+
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
239
|
+
def api_v1_video_upscale_post_with_http_info(opts = {})
|
|
240
|
+
if @api_client.config.debugging
|
|
241
|
+
@api_client.config.logger.debug 'Calling API: VideoApi.api_v1_video_upscale_post ...'
|
|
242
|
+
end
|
|
243
|
+
# resource path
|
|
244
|
+
local_var_path = '/api/v1/video-upscale'
|
|
245
|
+
|
|
246
|
+
# query parameters
|
|
247
|
+
query_params = opts[:query_params] || {}
|
|
248
|
+
|
|
249
|
+
# header parameters
|
|
250
|
+
header_params = opts[:header_params] || {}
|
|
251
|
+
# HTTP header 'Accept' (if needed)
|
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
253
|
+
# HTTP header 'Content-Type'
|
|
254
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
255
|
+
if !content_type.nil?
|
|
256
|
+
header_params['Content-Type'] = content_type
|
|
257
|
+
end
|
|
258
|
+
header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
|
|
259
|
+
|
|
260
|
+
# form parameters
|
|
261
|
+
form_params = opts[:form_params] || {}
|
|
262
|
+
|
|
263
|
+
# http body (model)
|
|
264
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
|
265
|
+
|
|
266
|
+
# return_type
|
|
267
|
+
return_type = opts[:debug_return_type] || 'TaskResponse'
|
|
268
|
+
|
|
269
|
+
# auth_names
|
|
270
|
+
auth_names = opts[:debug_auth_names] || []
|
|
271
|
+
|
|
272
|
+
new_options = opts.merge(
|
|
273
|
+
:operation => :"VideoApi.api_v1_video_upscale_post",
|
|
274
|
+
:header_params => header_params,
|
|
275
|
+
:query_params => query_params,
|
|
276
|
+
:form_params => form_params,
|
|
277
|
+
:body => post_body,
|
|
278
|
+
:auth_names => auth_names,
|
|
279
|
+
:return_type => return_type
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
283
|
+
if @api_client.config.debugging
|
|
284
|
+
@api_client.config.logger.debug "API called: VideoApi#api_v1_video_upscale_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
285
|
+
end
|
|
286
|
+
return data, status_code, headers
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|