getimg 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9278befbee725204753bb3f9bedb08ae51dba0782b35aa17149dd5ea49754070
4
- data.tar.gz: 350c69db91451ca82f21a597bcd624f5e19edd807797d761f1ae0946af42a5d9
3
+ metadata.gz: f1afb7594cb526ab50ac78d45fe06296e3dddb7f0c405c46379ab01486c9391b
4
+ data.tar.gz: 998563e15a69918d5838a16d8246c5390367ca0abbd509942830b89b2c759763
5
5
  SHA512:
6
- metadata.gz: e9b3f3489eb956d699b47011ab22a082de2b7be077de98279602ee8317b1ded2c74fec18edbc8722d67987576dc73a8dfec005a4088ccfb64a554cdf5f370114
7
- data.tar.gz: 1d1a56adc56e52034fb051afa762e620873d537c9b48d51823b5d250c5343506ee0e8b528afc7108e02f280e52dc2f0b8169c17669971f22468d2a1bc8b27702
6
+ metadata.gz: 45cf177d08c98576490f2ac4b6945efd0557b1e8368f193f0c25d634228aa8d14a4a63dfa78b6f4ba02e5490d267d97790a03d9e68859fb6a205b912fc85a351
7
+ data.tar.gz: b1343f3d6204d16ceafed56e158a6ad77dfb298a5d2502c145ab44679d3dbb911902eb5fe664abb50cbc28a3784459051f70323b49270da4e9309a930ef5b756
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Getimg
4
+ class Client
5
+ class Enhancements
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ # Body Params
11
+ # model string
12
+ # image string
13
+ # scale numbe
14
+ # output_format string
15
+
16
+ # gen = client.enhancements.upscale({model: "real-esrgan-4x", image: Getimg::Image.new.file_to_base64("xl-test.PNG"), scale: 4, output_format: "png"})
17
+ # Getimg::Image.new.base64_to_file(gen["image"])
18
+ def upscale(options = {})
19
+ @client.post("/enhancements/upscale", options)
20
+ end
21
+
22
+ # Body Params
23
+ # model string
24
+ # image string
25
+ # output_format string
26
+
27
+ # gen = client.enhancements.face_fix({model: "gfpgan-v1-3", image: Getimg::Image.new.file_to_base64("test.PNG"), output_format: "png"})
28
+ # Getimg::Image.new.base64_to_file(gen["image"])
29
+ def face_fix(options = {})
30
+ @client.post("/enhancements/face-fix", options)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -19,10 +19,39 @@ module Getimg
19
19
  # scheduler string
20
20
  # output_format string
21
21
 
22
- # client.stable_diffusion.text_to_image({model: "stable-diffusion-v1-5", prompt: "a photo of an astronaut riding a horse on mars", guidance: 7.5, width: 256, height: 256, steps: 25, output_format: "png"})
22
+ # gen = client.stable_diffusion.text_to_image({model: "stable-diffusion-v1-5", prompt: "a photo of an astronaut riding a horse", guidance: 7.5, width: 256, height: 256, steps: 25, output_format: "png"})
23
+ # Getimg::Image.new.base64_to_file(gen["image"])
23
24
  def text_to_image(options = {})
24
25
  @client.post("/stable-diffusion/text-to-image", options)
25
26
  end
27
+
28
+ # Body Params
29
+ # model string
30
+ # prompt string, required
31
+ # negative_prompt string
32
+ # image string, required
33
+ # strength number
34
+ # steps integer
35
+ # guidance number
36
+ # seed integer
37
+ # scheduler string
38
+ # output_format string
39
+
40
+ # client.stable_diffusion.image_to_image(
41
+ # {
42
+ # model: "stable-diffusion-v1-5",
43
+ # prompt: "mars",
44
+ # image: Getimg::Image.new.file_to_base64("test.PNG"),
45
+ # strength: 0.5,
46
+ # steps: 25,
47
+ # guidance: 7.5,
48
+ # output_format: "png"
49
+ # }
50
+ # )
51
+ # Getimg::Image.new.base64_to_file(gen["image"])
52
+ def image_to_image(options = {})
53
+ @client.post("/stable-diffusion/image-to-image", options)
54
+ end
26
55
  end
27
56
  end
28
57
  end
@@ -21,10 +21,31 @@ module Getimg
21
21
  # scheduler string
22
22
  # output_format string
23
23
 
24
- # client.stable_diffusion_xl.text_to_image({model: "stable-diffusion-xl-v1-0", prompt: "a photo of an astronaut riding a horse on mars", guidance: 7.5, width: 1024, height: 1024, steps: 30, output_format: "png"})
24
+ # gen = client.stable_diffusion_xl.text_to_image({model: "stable-diffusion-xl-v1-0", prompt: "a photo of an astronaut riding a horse", guidance: 7.5, width: 1024, height: 1024, steps: 30, output_format: "png"})
25
+ # Getimg::Image.new.base64_to_file(gen["image"])
25
26
  def text_to_image(options = {})
26
27
  @client.post("/stable-diffusion-xl/text-to-image", options)
27
28
  end
29
+
30
+ # Body Params
31
+ # model string
32
+ # prompt string, required
33
+ # negative_prompt string
34
+ # prompt_2 string
35
+ # negative_prompt_2 string
36
+ # image string, required
37
+ # strength number
38
+ # steps integer
39
+ # guidance number
40
+ # seed integer
41
+ # scheduler string
42
+ # output_format string
43
+
44
+ # gen = client.stable_diffusion_xl.image_to_image({model: "stable-diffusion-xl-v1-0", prompt: "mars background", image: Getimg::Image.new.file_to_base64("xl-test.PNG"), strength: 0.5, steps: 50, guidance: 7.5, output_format: "png"})
45
+ # Getimg::Image.new.base64_to_file(gen["image"])
46
+ def image_to_image(options = {})
47
+ @client.post("/stable-diffusion-xl/image-to-image", options)
48
+ end
28
49
  end
29
50
  end
30
51
  end
data/lib/getimg/client.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require "getimg/client/models"
4
4
  require "getimg/client/stable_diffusion"
5
5
  require "getimg/client/stable_diffusion_xl"
6
+ require "getimg/client/enhancements"
6
7
  require "getimg/client/account"
7
8
 
8
9
  module Getimg
@@ -34,6 +35,10 @@ module Getimg
34
35
  @stable_diffusion_xl ||= StableDiffusionXl.new(self)
35
36
  end
36
37
 
38
+ def enhancements
39
+ @enhancements ||= Enhancements.new(self)
40
+ end
41
+
37
42
  def account
38
43
  @account ||= Account.new(self)
39
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Getimg
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getimg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - acidtib
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-09 00:00:00.000000000 Z
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -44,7 +44,7 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 3.16.1
47
- description: Client library for getimg API.
47
+ description: 'Ruby bindings for getimg.ai, APIs can be found here: https://docs.getimg.ai'
48
48
  email:
49
49
  - arubinofaux@gmail.com
50
50
  executables: []
@@ -60,6 +60,7 @@ files:
60
60
  - lib/getimg.rb
61
61
  - lib/getimg/client.rb
62
62
  - lib/getimg/client/account.rb
63
+ - lib/getimg/client/enhancements.rb
63
64
  - lib/getimg/client/models.rb
64
65
  - lib/getimg/client/stable_diffusion.rb
65
66
  - lib/getimg/client/stable_diffusion_xl.rb
@@ -90,5 +91,5 @@ requirements: []
90
91
  rubygems_version: 3.4.21
91
92
  signing_key:
92
93
  specification_version: 4
93
- summary: Client library for getimg API.
94
+ summary: Ruby bindings for getimg.ai
94
95
  test_files: []