runapi-nano-banana 0.2.9 → 0.2.11
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5f3abde20ddbde997ac45b189e30db3a876b7e643d72bcf364c5e87838a881d
|
|
4
|
+
data.tar.gz: d18271b8269cd6caae4e075e81dee9f5dc95ac6a68aab2340876301bbeb76a20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 449e22c7c0d85c10e117b7d342a39c99502fb6a0844622be97686b7971619291d226c5cd196f0ffe949ddcfbecbce1d88431169155515302871de08704ccb7e7
|
|
7
|
+
data.tar.gz: f6fcca9337bbab265d726c1ecbaedc941b5efe5af4193967687a675e0dc39624c28425de5b5fd2070ca07656c639274f2ce17cc9adef06e24fec2800dacf8f4b
|
|
@@ -4,9 +4,8 @@ module RunApi
|
|
|
4
4
|
module NanoBanana
|
|
5
5
|
# NanoBanana image generation and editing API client.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# 14 reference images). Editing uses the dedicated +nano-banana-edit+ model.
|
|
7
|
+
# Generation tiers include standard, pro, v2, and v2 lite. Image editing
|
|
8
|
+
# supports +nano-banana-2-lite+ and the dedicated +nano-banana-edit+ model.
|
|
10
9
|
#
|
|
11
10
|
# @example
|
|
12
11
|
# client = RunApi::NanoBanana::Client.new(api_key: "your-api-key")
|
|
@@ -4,8 +4,25 @@ module RunApi
|
|
|
4
4
|
module NanoBanana
|
|
5
5
|
CONTRACT = {
|
|
6
6
|
"edit-image" => {
|
|
7
|
-
"models" => ["nano-banana-edit"],
|
|
7
|
+
"models" => ["nano-banana-2-lite", "nano-banana-edit"],
|
|
8
8
|
"fields_by_model" => {
|
|
9
|
+
"nano-banana-2-lite" => {
|
|
10
|
+
"aspect_ratio" => {
|
|
11
|
+
"enum" => ["1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9", "auto"],
|
|
12
|
+
"required" => true
|
|
13
|
+
},
|
|
14
|
+
"prompt" => {
|
|
15
|
+
"required" => true,
|
|
16
|
+
"min" => 1,
|
|
17
|
+
"max" => 20000,
|
|
18
|
+
"length" => true
|
|
19
|
+
},
|
|
20
|
+
"source_image_urls" => {
|
|
21
|
+
"required" => true,
|
|
22
|
+
"min_items" => 1,
|
|
23
|
+
"max_items" => 10
|
|
24
|
+
}
|
|
25
|
+
},
|
|
9
26
|
"nano-banana-edit" => {
|
|
10
27
|
"aspect_ratio" => {
|
|
11
28
|
"enum" => ["1:1", "9:16", "16:9", "3:4", "4:3", "3:2", "2:3", "5:4", "4:5", "21:9", "auto"]
|
|
@@ -17,7 +34,13 @@ module RunApi
|
|
|
17
34
|
"required" => true
|
|
18
35
|
}
|
|
19
36
|
}
|
|
20
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"rules" => [{
|
|
39
|
+
"when" => {
|
|
40
|
+
"model" => "nano-banana-2-lite"
|
|
41
|
+
},
|
|
42
|
+
"forbidden" => ["output_format"]
|
|
43
|
+
}]
|
|
21
44
|
},
|
|
22
45
|
"text-to-image" => {
|
|
23
46
|
"models" => ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-pro"],
|
|
@@ -51,6 +74,9 @@ module RunApi
|
|
|
51
74
|
"min" => 1,
|
|
52
75
|
"max" => 20000,
|
|
53
76
|
"length" => true
|
|
77
|
+
},
|
|
78
|
+
"reference_image_urls" => {
|
|
79
|
+
"max_items" => 10
|
|
54
80
|
}
|
|
55
81
|
},
|
|
56
82
|
"nano-banana-pro" => {
|
|
@@ -4,11 +4,12 @@ module RunApi
|
|
|
4
4
|
module NanoBanana
|
|
5
5
|
module Resources
|
|
6
6
|
# NanoBanana image editing resource.
|
|
7
|
-
# Edit existing images using text prompts and
|
|
7
|
+
# Edit existing images using text prompts and source images.
|
|
8
8
|
class EditImage
|
|
9
9
|
include RunApi::Core::ResourceHelpers
|
|
10
10
|
|
|
11
11
|
ENDPOINT = "/api/v1/nano_banana/edit_image"
|
|
12
|
+
DEFAULT_MODEL = "nano-banana-2-lite"
|
|
12
13
|
|
|
13
14
|
RESPONSE_CLASS = Types::EditImageResponse
|
|
14
15
|
COMPLETED_RESPONSE_CLASS = Types::CompletedEditImageResponse
|
|
@@ -32,6 +33,7 @@ module RunApi
|
|
|
32
33
|
# @return [RunApi::NanoBanana::Types::EditImageResponse] task creation result with id
|
|
33
34
|
def create(options: nil, **params)
|
|
34
35
|
params = compact_params(params)
|
|
36
|
+
params[:model] = DEFAULT_MODEL unless param(params, :model)
|
|
35
37
|
validate_params!(params)
|
|
36
38
|
request(:post, ENDPOINT, body: params, options: options)
|
|
37
39
|
end
|
|
@@ -9,6 +9,7 @@ module RunApi
|
|
|
9
9
|
include RunApi::Core::ResourceHelpers
|
|
10
10
|
|
|
11
11
|
ENDPOINT = "/api/v1/nano_banana/text_to_image"
|
|
12
|
+
DEFAULT_MODEL = "nano-banana-2-lite"
|
|
12
13
|
|
|
13
14
|
RESPONSE_CLASS = Types::TextToImageResponse
|
|
14
15
|
COMPLETED_RESPONSE_CLASS = Types::CompletedTextToImageResponse
|
|
@@ -29,7 +30,7 @@ module RunApi
|
|
|
29
30
|
# Create an image generation task.
|
|
30
31
|
#
|
|
31
32
|
# @param params [Hash] generation parameters
|
|
32
|
-
# @option params [String] :model
|
|
33
|
+
# @option params [String] :model optional; defaults to "nano-banana-2-lite"
|
|
33
34
|
# @option params [String] :prompt required; image description
|
|
34
35
|
# @option params [String] :aspect_ratio optional; required for nano-banana-2-lite
|
|
35
36
|
# @option params [String] :output_format optional; "png", "jpeg", or "jpg" (not supported by nano-banana-2-lite)
|
|
@@ -39,6 +40,7 @@ module RunApi
|
|
|
39
40
|
# @return [RunApi::NanoBanana::Types::TextToImageResponse] task creation result with id
|
|
40
41
|
def create(options: nil, **params)
|
|
41
42
|
params = compact_params(params)
|
|
43
|
+
params[:model] = DEFAULT_MODEL unless param(params, :model)
|
|
42
44
|
validate_params!(params)
|
|
43
45
|
request(:post, ENDPOINT, body: params, options: options)
|
|
44
46
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runapi-nano-banana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.11
|
|
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.
|
|
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.
|
|
25
|
+
version: 0.2.14
|
|
26
26
|
description: The Nano Banana Ruby SDK is the language-specific package for Nano Banana
|
|
27
27
|
on RunAPI. Use this package for image generation, image editing, and creative production
|
|
28
28
|
workflows when your application needs request bodies, task status lookup, and consistent
|