runapi-flux-2 0.2.8 → 0.3.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 +4 -4
- data/README.md +4 -0
- data/lib/runapi/flux_2/contract_gen.rb +112 -7
- data/lib/runapi/flux_2/types.rb +2 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c634d010d5d4744ce8e2811c5705149c620778591a7969c06e2227f463376b3b
|
|
4
|
+
data.tar.gz: 434c41db48cd75e99215be821afd491ef413c82c99f0f3dd81fdd310f994388f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 190af50f6f040b2e9931eca396f5ec886878fea787980f8432b92eb08b5f6ee115b9b5ee26ab96cc6857c21544d66204e1de3c0386d584f1e525bc7c1d5308b8
|
|
7
|
+
data.tar.gz: 6bbf2e9ec1837adc9d271a1e30d486259dd1538c807b712e850d7e8b8a79dc1dfd0d0d7e1597716c235335b7d7513f5b57adb77d740b52c27c0931470dbf10ec
|
data/README.md
CHANGED
|
@@ -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
|
|
@@ -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
|
data/lib/runapi/flux_2/types.rb
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Flux2
|
|
5
5
|
# Type definitions for Flux 2.
|
|
6
|
-
# Each operation has
|
|
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.
|
|
4
|
+
version: 0.3.0
|
|
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.
|
|
18
|
+
version: 0.3.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.
|
|
25
|
+
version: 0.3.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
|
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
requirements: []
|
|
70
|
-
rubygems_version: 4.0.
|
|
70
|
+
rubygems_version: 4.0.17
|
|
71
71
|
specification_version: 4
|
|
72
72
|
summary: Flux 2 API Ruby SDK for RunAPI
|
|
73
73
|
test_files: []
|