Class: Getimg::Client::Enhancements

Inherits:
Object
  • Object
show all
Defined in:
lib/getimg/client/enhancements.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Enhancements

Returns a new instance of Enhancements.



6
7
8
# File 'lib/getimg/client/enhancements.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#face_fix(options = {}) ⇒ Object

gen = client.enhancements.face_fix(“gfpgan-v1-3”, image: Getimg::Image.new.file_to_base64(“test.PNG”), output_format: “png”) Getimg::Image.new.base64_to_file(gen)



29
30
31
# File 'lib/getimg/client/enhancements.rb', line 29

def face_fix(options = {})
  @client.post("/enhancements/face-fix", options)
end

#upscale(options = {}) ⇒ Object

gen = client.enhancements.upscale(“real-esrgan-4x”, image: Getimg::Image.new.file_to_base64(“xl-test.PNG”), scale: 4, output_format: “png”) Getimg::Image.new.base64_to_file(gen)



18
19
20
# File 'lib/getimg/client/enhancements.rb', line 18

def upscale(options = {})
  @client.post("/enhancements/upscale", options)
end