Class: Getimg::Client::StableDiffusion
- Inherits:
-
Object
- Object
- Getimg::Client::StableDiffusion
- Defined in:
- lib/getimg/client/stable_diffusion.rb
Instance Method Summary collapse
-
#image_to_image(options = {}) ⇒ Object
client.stable_diffusion.image_to_image( { model: “stable-diffusion-v1-5”, prompt: “mars”, image: Getimg::Image.new.file_to_base64(“test.PNG”), strength: 0.5, steps: 25, guidance: 7.5, output_format: “png” } ) Getimg::Image.new.base64_to_file(gen).
-
#initialize(client) ⇒ StableDiffusion
constructor
A new instance of StableDiffusion.
-
#text_to_image(options = {}) ⇒ Object
gen = client.stable_diffusion.text_to_image(“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”) Getimg::Image.new.base64_to_file(gen).
Constructor Details
#initialize(client) ⇒ StableDiffusion
Returns a new instance of StableDiffusion.
6 7 8 |
# File 'lib/getimg/client/stable_diffusion.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#image_to_image(options = {}) ⇒ Object
client.stable_diffusion.image_to_image(
{
model: "stable-diffusion-v1-5",
prompt: "mars",
image: Getimg::Image.new.file_to_base64("test.PNG"),
strength: 0.5,
steps: 25,
guidance: 7.5,
output_format: "png"
}
52 53 54 |
# File 'lib/getimg/client/stable_diffusion.rb', line 52 def image_to_image( = {}) @client.post("/stable-diffusion/image-to-image", ) end |
#text_to_image(options = {}) ⇒ Object
gen = client.stable_diffusion.text_to_image(“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”) Getimg::Image.new.base64_to_file(gen)
24 25 26 |
# File 'lib/getimg/client/stable_diffusion.rb', line 24 def text_to_image( = {}) @client.post("/stable-diffusion/text-to-image", ) end |