leoandruby 0.1.2 → 0.2.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/CHANGELOG.md +9 -1
- data/README.md +5 -3
- data/lib/leoandruby/client.rb +3 -2
- data/lib/leoandruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638e39f8fb7c349a1f6bd4c4dbcd548d6a552f826d20bbe7f95d5f9064267ed3
|
4
|
+
data.tar.gz: f5fafdb80e01a028eba24a0232f0e2725c3927a4c73daff75f0a75a09fdb1b66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf2a5818986f0057e76bf7577a4907334a1eacc47adc718ff28a3afcd1fc846627e5d2d56f7a15b3d4c070f7f67f0dce1ce1050ee90a6bb3a5bf3d164c817b83
|
7
|
+
data.tar.gz: '08baacb5984c10741d5264a4ed4f888e560a428ccf3f19bdbfbc62350b64b51da02eb29009d54fa41698b59c9199b8ceabdf5c6c6badf7a186f749c5f6931a3e'
|
data/CHANGELOG.md
CHANGED
@@ -6,4 +6,12 @@
|
|
6
6
|
|
7
7
|
## [0.1.1] - 2024-11-21
|
8
8
|
|
9
|
-
- Bug Fixes
|
9
|
+
- Bug Fixes
|
10
|
+
|
11
|
+
## [0.1.2] - 2024-11-21
|
12
|
+
|
13
|
+
- Improved: Refactored code to use StandardRB style.
|
14
|
+
|
15
|
+
## [0.2.0] - 2024-11-22
|
16
|
+
|
17
|
+
- Added: New Feature allows user to specify how many images to generate, defaulting to 1.
|
data/README.md
CHANGED
@@ -59,14 +59,15 @@ client = LeoAndRuby::Client.new(api_key)
|
|
59
59
|
|
60
60
|
### 2. Generate an Image
|
61
61
|
|
62
|
-
You can generate an image by providing the prompt, model ID, width, and
|
62
|
+
You can generate an image by providing the prompt, model ID, width, height, and optionally the number of images:
|
63
63
|
|
64
64
|
```ruby
|
65
65
|
generation_response = client.generate_image(
|
66
66
|
prompt: 'An oil painting of a cat',
|
67
67
|
model_id: '6bef9f1b-29cb-40c7-b9df-32b51c1f67d3',
|
68
68
|
width: 512,
|
69
|
-
height: 512
|
69
|
+
height: 512,
|
70
|
+
num_images: 1 # Optional, defaults to 1 if not specified
|
70
71
|
)
|
71
72
|
|
72
73
|
generation_id = generation_response['sdGenerationJob']['generationId']
|
@@ -119,7 +120,8 @@ generation_response = client.generate_image(
|
|
119
120
|
prompt: 'A futuristic cityscape at sunset',
|
120
121
|
model_id: '6bef9f1b-29cb-40c7-b9df-32b51c1f67d3',
|
121
122
|
width: 1024,
|
122
|
-
height: 768
|
123
|
+
height: 768,
|
124
|
+
num_images: 1 # Optional, defaults to 1 if not specified
|
123
125
|
)
|
124
126
|
|
125
127
|
generation_id = generation_response['sdGenerationJob']['generationId']
|
data/lib/leoandruby/client.rb
CHANGED
@@ -10,7 +10,7 @@ module LeoAndRuby
|
|
10
10
|
@api_key = api_key
|
11
11
|
end
|
12
12
|
|
13
|
-
def generate_image(prompt:, model_id:, width:, height:)
|
13
|
+
def generate_image(prompt:, model_id:, width:, height:, num_images: 1)
|
14
14
|
uri = URI("#{API_BASE_URL}/generations")
|
15
15
|
request = Net::HTTP::Post.new(uri)
|
16
16
|
request["Accept"] = "application/json"
|
@@ -21,7 +21,8 @@ module LeoAndRuby
|
|
21
21
|
prompt: prompt,
|
22
22
|
modelId: model_id,
|
23
23
|
width: width,
|
24
|
-
height: height
|
24
|
+
height: height,
|
25
|
+
num_images: num_images
|
25
26
|
}.to_json
|
26
27
|
|
27
28
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
data/lib/leoandruby/version.rb
CHANGED