runapi-flux-2 0.2.8 → 0.3.1

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: d544661cb2f60b5ce01db31957bbd31c34aceba21b784ded8afe989327a7b27b
4
- data.tar.gz: cbeaa074da2d18d81869030cd38f2f505a71705a95b740ae18aecc3e364850c8
3
+ metadata.gz: 279584b14f3affb0a80ea447cc7d21f41ba14f1de8b2bb6c4f31dc4180ab9725
4
+ data.tar.gz: 3270bebb69677411b282feb003fd6177bb41ae6607b59017ea00f3bcfb0a27f2
5
5
  SHA512:
6
- metadata.gz: 7590f860d80b15991edd473001b6a537dcf74c763574e27bed6aa6d02c487d07f1c3324681fc4c873cbb4b7ed8578588a32f88ae2d93a69b65c5a0ab2d5a2f22
7
- data.tar.gz: e4a8ff221b6d0234bf99a537d2500f132a6c3092e6a83a3813a1c6d1c1f130bf96ab0e52fdf8a4bd36da5a133ff022b8c14a4d91d5ab7d7faf6b58aa9eeca892
6
+ metadata.gz: be457fb3c2cdb918f2c8fad9c530eb747352fb2acdd7ae7a67cc78a90f843e86eeb805f8488405ec9869ab04a41cf472f77fba6b38b8298dbf01dff12daf774c
7
+ data.tar.gz: 6b603ca7cd1a0404defaa22e400abad7340b283709e6862de138ffe34bdc32def624ab0788e3ce8f5d800f5b0b0531215303fdf4b7414c2e63aa6ffbe1ef373a
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Flux 2 Ruby SDK is the language-specific package for Flux 2 on RunAPI. Use this package for image generation, image editing, and creative production workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
4
 
5
- This README is the Ruby package guide inside the public `flux-2-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/flux-2; for API reference, use https://runapi.ai/docs#flux-2; for SDK docs, use https://runapi.ai/docs#sdk-flux-2.
5
+ This README is the Ruby package guide inside the public `flux-2-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/flux-2; for API reference, use https://runapi.ai/docs/api/flux-2/text-to-image; for SDK docs, use https://runapi.ai/docs/resources/sdks.
6
6
 
7
7
  ## Install
8
8
 
@@ -34,6 +34,10 @@ remix = client.remix_image.create(
34
34
 
35
35
  Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
36
36
 
37
+ ## Flux 2 Max
38
+
39
+ Use `flux-2-max-text-to-image` or `flux-2-max-remix-image` for the highest-quality tier. Max requires a concrete `aspect_ratio`, supports `output_resolution: "1k"` and `output_count: 1` only, and accepts exactly one public HTTP(S) source image for remix.
40
+
37
41
  RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
38
42
 
39
43
  ## Language notes
@@ -43,8 +47,8 @@ Use Ruby keyword arguments and the `RunApi::Flux2` error classes when building i
43
47
  ## Links
44
48
 
45
49
  - Model page: https://runapi.ai/models/flux-2
46
- - SDK docs: https://runapi.ai/docs#sdk-flux-2
47
- - Product docs: https://runapi.ai/docs#flux-2
50
+ - SDK docs: https://runapi.ai/docs/resources/sdks
51
+ - Product docs: https://runapi.ai/docs/api/flux-2/text-to-image
48
52
  - Pricing and rate limits: https://runapi.ai/models/flux-2/pro-text-to-image
49
53
  - Provider comparison: https://runapi.ai/providers/black-forest-labs
50
54
  - Full catalog: https://runapi.ai/models
@@ -4,17 +4,23 @@ module RunApi
4
4
  module Flux2
5
5
  CONTRACT = {
6
6
  "remix-image" => {
7
- "models" => ["flux-2-flex-remix-image", "flux-2-pro-remix-image"],
7
+ "models" => ["flux-2-flex-remix-image", "flux-2-max-remix-image", "flux-2-pro-remix-image"],
8
8
  "fields_by_model" => {
9
9
  "flux-2-flex-remix-image" => {
10
10
  "aspect_ratio" => {
11
11
  "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "auto"]
12
12
  },
13
+ "model" => {
14
+ "required" => true
15
+ },
13
16
  "output_resolution" => {
14
17
  "enum" => ["1k", "2k"]
15
18
  },
16
19
  "prompt" => {
17
- "required" => true
20
+ "required" => true,
21
+ "min" => 3,
22
+ "max" => 5000,
23
+ "length" => true
18
24
  },
19
25
  "source_image_urls" => {
20
26
  "required" => true,
@@ -22,15 +28,48 @@ module RunApi
22
28
  "max_items" => 8
23
29
  }
24
30
  },
31
+ "flux-2-max-remix-image" => {
32
+ "aspect_ratio" => {
33
+ "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"],
34
+ "required" => true
35
+ },
36
+ "model" => {
37
+ "required" => true
38
+ },
39
+ "output_count" => {
40
+ "enum" => [1],
41
+ "type" => "integer"
42
+ },
43
+ "output_resolution" => {
44
+ "enum" => ["1k"]
45
+ },
46
+ "prompt" => {
47
+ "required" => true,
48
+ "min" => 3,
49
+ "max" => 5000,
50
+ "length" => true
51
+ },
52
+ "source_image_urls" => {
53
+ "required" => true,
54
+ "min_items" => 1,
55
+ "max_items" => 1
56
+ }
57
+ },
25
58
  "flux-2-pro-remix-image" => {
26
59
  "aspect_ratio" => {
27
60
  "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "auto"]
28
61
  },
62
+ "model" => {
63
+ "required" => true
64
+ },
29
65
  "output_resolution" => {
30
66
  "enum" => ["1k", "2k"]
31
67
  },
32
68
  "prompt" => {
33
- "required" => true
69
+ "required" => true,
70
+ "min" => 3,
71
+ "max" => 5000,
72
+ "length" => true
34
73
  },
35
74
  "source_image_urls" => {
36
75
  "required" => true,
@@ -38,34 +77,100 @@ module RunApi
38
77
  "max_items" => 8
39
78
  }
40
79
  }
41
- }
80
+ },
81
+ "rules" => [{
82
+ "when" => {
83
+ "model" => "flux-2-flex-remix-image"
84
+ },
85
+ "forbidden" => ["output_count"]
86
+ }, {
87
+ "when" => {
88
+ "model" => "flux-2-max-remix-image"
89
+ },
90
+ "forbidden" => ["enable_safety_checker"]
91
+ }, {
92
+ "when" => {
93
+ "model" => "flux-2-pro-remix-image"
94
+ },
95
+ "forbidden" => ["output_count"]
96
+ }]
42
97
  },
43
98
  "text-to-image" => {
44
- "models" => ["flux-2-flex-text-to-image", "flux-2-pro-text-to-image"],
99
+ "models" => ["flux-2-flex-text-to-image", "flux-2-max-text-to-image", "flux-2-pro-text-to-image"],
45
100
  "fields_by_model" => {
46
101
  "flux-2-flex-text-to-image" => {
47
102
  "aspect_ratio" => {
48
103
  "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"]
49
104
  },
105
+ "model" => {
106
+ "required" => true
107
+ },
50
108
  "output_resolution" => {
51
109
  "enum" => ["1k", "2k"]
52
110
  },
53
111
  "prompt" => {
112
+ "required" => true,
113
+ "min" => 3,
114
+ "max" => 5000,
115
+ "length" => true
116
+ }
117
+ },
118
+ "flux-2-max-text-to-image" => {
119
+ "aspect_ratio" => {
120
+ "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"],
54
121
  "required" => true
122
+ },
123
+ "model" => {
124
+ "required" => true
125
+ },
126
+ "output_count" => {
127
+ "enum" => [1],
128
+ "type" => "integer"
129
+ },
130
+ "output_resolution" => {
131
+ "enum" => ["1k"]
132
+ },
133
+ "prompt" => {
134
+ "required" => true,
135
+ "min" => 3,
136
+ "max" => 5000,
137
+ "length" => true
55
138
  }
56
139
  },
57
140
  "flux-2-pro-text-to-image" => {
58
141
  "aspect_ratio" => {
59
142
  "enum" => ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"]
60
143
  },
144
+ "model" => {
145
+ "required" => true
146
+ },
61
147
  "output_resolution" => {
62
148
  "enum" => ["1k", "2k"]
63
149
  },
64
150
  "prompt" => {
65
- "required" => true
151
+ "required" => true,
152
+ "min" => 3,
153
+ "max" => 5000,
154
+ "length" => true
66
155
  }
67
156
  }
68
- }
157
+ },
158
+ "rules" => [{
159
+ "when" => {
160
+ "model" => "flux-2-flex-text-to-image"
161
+ },
162
+ "forbidden" => ["output_count"]
163
+ }, {
164
+ "when" => {
165
+ "model" => "flux-2-max-text-to-image"
166
+ },
167
+ "forbidden" => ["enable_safety_checker"]
168
+ }, {
169
+ "when" => {
170
+ "model" => "flux-2-pro-text-to-image"
171
+ },
172
+ "forbidden" => ["output_count"]
173
+ }]
69
174
  }
70
175
  }.freeze
71
176
  end
@@ -3,7 +3,8 @@
3
3
  module RunApi
4
4
  module Flux2
5
5
  # Type definitions for Flux 2.
6
- # Each operation has pro (higher fidelity) and flex (faster, lower cost) tiers.
6
+ # Each operation has Pro, Flex, and Max tiers. Max requires a concrete
7
+ # aspect ratio, supports 1k output only, and produces one image.
7
8
  module Types
8
9
  # A single generated image with its CDN URL.
9
10
  class Image < RunApi::Core::BaseModel
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.8
4
+ version: 0.3.1
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.14
18
+ version: 0.4.0
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.14
25
+ version: 0.4.0
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