Class: RunApi::QwenImage::Resources::RemixImage
- Inherits:
-
Object
- Object
- RunApi::QwenImage::Resources::RemixImage
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/qwen_image/resources/remix_image.rb
Overview
QwenImage remix-image resource. Creates prompt-guided variations from a source image.
Constant Summary collapse
- ENDPOINT =
"/api/v1/qwen_image/remix_image"- RESPONSE_CLASS =
Types::RemixImageResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedRemixImageResponse
Instance Method Summary collapse
-
#create(options: nil, **params) ⇒ RunApi::QwenImage::Types::RemixImageResponse
Create a remix-image task.
-
#get(id, options: nil) ⇒ RunApi::QwenImage::Types::RemixImageResponse
Get remix-image status by task ID.
-
#initialize(http) ⇒ RemixImage
constructor
A new instance of RemixImage.
-
#run(options: nil, **params) ⇒ RunApi::QwenImage::Types::CompletedRemixImageResponse
Remix an image and wait until complete.
Constructor Details
#initialize(http) ⇒ RemixImage
Returns a new instance of RemixImage.
15 16 17 |
# File 'lib/runapi/qwen_image/resources/remix_image.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ RunApi::QwenImage::Types::RemixImageResponse
Create a remix-image task.
32 33 34 35 36 |
# File 'lib/runapi/qwen_image/resources/remix_image.rb', line 32 def create(options: nil, **params) params = compact_params(params) validate_contract!(CONTRACT["remix-image"], params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ RunApi::QwenImage::Types::RemixImageResponse
Get remix-image status by task ID.
42 43 44 |
# File 'lib/runapi/qwen_image/resources/remix_image.rb', line 42 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ RunApi::QwenImage::Types::CompletedRemixImageResponse
Remix an image and wait until complete.
23 24 25 26 |
# File 'lib/runapi/qwen_image/resources/remix_image.rb', line 23 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |