Class: Getimg::Client::StableDiffusionXl

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StableDiffusionXl

Returns a new instance of StableDiffusionXl.



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

def initialize(client)
  @client = client
end

Instance Method Details

#image_to_image(options = {}) ⇒ Object

gen = client.stable_diffusion_xl.image_to_image(“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”) Getimg::Image.new.base64_to_file(gen)



46
47
48
# File 'lib/getimg/client/stable_diffusion_xl.rb', line 46

def image_to_image(options = {})
  @client.post("/stable-diffusion-xl/image-to-image", options)
end

#text_to_image(options = {}) ⇒ Object

gen = client.stable_diffusion_xl.text_to_image(“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”) Getimg::Image.new.base64_to_file(gen)



26
27
28
# File 'lib/getimg/client/stable_diffusion_xl.rb', line 26

def text_to_image(options = {})
  @client.post("/stable-diffusion-xl/text-to-image", options)
end