Class: Getimg::Client::StableDiffusionXl
- Inherits:
-
Object
- Object
- Getimg::Client::StableDiffusionXl
- Defined in:
- lib/getimg/client/stable_diffusion_xl.rb
Instance Method Summary collapse
-
#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).
-
#initialize(client) ⇒ StableDiffusionXl
constructor
A new instance of StableDiffusionXl.
-
#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).
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( = {}) @client.post("/stable-diffusion-xl/image-to-image", ) 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( = {}) @client.post("/stable-diffusion-xl/text-to-image", ) end |