runapi-flux-2 0.2.7 → 0.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d2f7af4be782a923b65df9f4f52418b1afa976271cca57a99931c313040b1ce
4
- data.tar.gz: 9f2e464857535f906008da2404a43c5183cc1c5e56cecf174eaedbeb54fff064
3
+ metadata.gz: d544661cb2f60b5ce01db31957bbd31c34aceba21b784ded8afe989327a7b27b
4
+ data.tar.gz: cbeaa074da2d18d81869030cd38f2f505a71705a95b740ae18aecc3e364850c8
5
5
  SHA512:
6
- metadata.gz: 3e4064be7f3a33af749e40c6ae7d0d3a0fadff165f50b97fa00e74f5122195a7f97fc8727a2f19896498c2502ab8ae9c8f3ce03ba23c381358c83f22f356a9c4
7
- data.tar.gz: 2b0450f7cb1d201d8978a9bcc7f42e4ca3756a07f4e146c6cb563bc1d688e6e246b9ee1490c2843e8566135202ce7bffea63eccfb8f7b4bbe25504ef22352a20
6
+ metadata.gz: 7590f860d80b15991edd473001b6a537dcf74c763574e27bed6aa6d02c487d07f1c3324681fc4c873cbb4b7ed8578588a32f88ae2d93a69b65c5a0ab2d5a2f22
7
+ data.tar.gz: e4a8ff221b6d0234bf99a537d2500f132a6c3092e6a83a3813a1c6d1c1f130bf96ab0e52fdf8a4bd36da5a133ff022b8c14a4d91d5ab7d7faf6b58aa9eeca892
@@ -17,7 +17,9 @@ module RunApi
17
17
  "required" => true
18
18
  },
19
19
  "source_image_urls" => {
20
- "required" => true
20
+ "required" => true,
21
+ "min_items" => 1,
22
+ "max_items" => 8
21
23
  }
22
24
  },
23
25
  "flux-2-pro-remix-image" => {
@@ -31,7 +33,9 @@ module RunApi
31
33
  "required" => true
32
34
  },
33
35
  "source_image_urls" => {
34
- "required" => true
36
+ "required" => true,
37
+ "min_items" => 1,
38
+ "max_items" => 8
35
39
  }
36
40
  }
37
41
  }
@@ -17,19 +17,19 @@ module RunApi
17
17
  @http = http
18
18
  end
19
19
 
20
- def run(**params)
21
- task = create(**params)
22
- poll_until_complete { get(task.id) }
20
+ def run(options: nil, **params)
21
+ task = create(options: options, **params)
22
+ poll_until_complete { get(task.id, options: options) }
23
23
  end
24
24
 
25
- def create(**params)
25
+ def create(options: nil, **params)
26
26
  params = compact_params(params)
27
27
  validate_contract!(CONTRACT["remix-image"], params)
28
- request(:post, ENDPOINT, body: params)
28
+ request(:post, ENDPOINT, body: params, options: options)
29
29
  end
30
30
 
31
- def get(id)
32
- request(:get, "#{ENDPOINT}/#{id}")
31
+ def get(id, options: nil)
32
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
33
33
  end
34
34
  end
35
35
  end
@@ -21,27 +21,27 @@ module RunApi
21
21
  #
22
22
  # @param params [Hash] text-to-image parameters
23
23
  # @return [RunApi::Flux2::Types::CompletedTextToImageResponse] completed text-to-image result
24
- def run(**params)
25
- task = create(**params)
26
- poll_until_complete { get(task.id) }
24
+ def run(options: nil, **params)
25
+ task = create(options: options, **params)
26
+ poll_until_complete { get(task.id, options: options) }
27
27
  end
28
28
 
29
29
  # Create a text-to-image task.
30
30
  #
31
31
  # @param params [Hash] text-to-image parameters
32
32
  # @return [RunApi::Flux2::Types::TextToImageResponse] task creation result with id
33
- def create(**params)
33
+ def create(options: nil, **params)
34
34
  params = compact_params(params)
35
35
  validate_contract!(CONTRACT["text-to-image"], params)
36
- request(:post, ENDPOINT, body: params)
36
+ request(:post, ENDPOINT, body: params, options: options)
37
37
  end
38
38
 
39
39
  # Get text-to-image status by task ID.
40
40
  #
41
41
  # @param id [String] task ID
42
42
  # @return [RunApi::Flux2::Types::TextToImageResponse] current text-to-image status
43
- def get(id)
44
- request(:get, "#{ENDPOINT}/#{id}")
43
+ def get(id, options: nil)
44
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
45
45
  end
46
46
  end
47
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-flux-2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.7
18
+ version: 0.2.14
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.7
25
+ version: 0.2.14
26
26
  description: The Flux 2 Ruby SDK is the language-specific package for Flux 2 on RunAPI.
27
27
  Use this package for image generation, image editing, and creative production workflows
28
28
  when your application needs request bodies, task status lookup, and consistent RunAPI