File size: 1,322 Bytes
01710f4
9d3bdee
f1ac645
 
9d3bdee
f1ac645
 
 
bdb6857
 
 
 
 
 
 
 
 
f1ac645
 
 
 
 
 
 
bdb6857
f1ac645
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import gradio as gr
from gradio_client import Client

def generate_image(prompt, negative_prompt, seed, width, height, prior_inference_steps, prior_guidance_scale, decoder_inference_steps, decoder_guidance_scale, num_images):
    client = Client("multimodalart/stable-cascade")
    result = client.predict(
        prompt,
        negative_prompt,
		0,	# float (numeric value between 0 and 2147483647) in 'Seed' Slider component
		1024,	# float (numeric value between 1024 and 1536) in 'Width' Slider component
		1024,	# float (numeric value between 1024 and 1536) in 'Height' Slider component
		10,	# float (numeric value between 10 and 30) in 'Prior Inference Steps' Slider component
		0,	# float (numeric value between 0 and 20) in 'Prior Guidance Scale' Slider component
		4,	# float (numeric value between 4 and 12) in 'Decoder Inference Steps' Slider component
		0,	# float (numeric value between 0 and 0) in 'Decoder Guidance Scale' Slider component
		1,	# float (numeric value between 1 and 2) in 'Number of Images' Slider component
		api_name="/run"
    )
    return result

demo = gr.Interface(
    fn=generate_image,
    inputs=[
        gr.Textbox(label="Prompt"),
        gr.Textbox(label="Negative prompt", value="bad quality, low quality"),
    ],
    outputs=["image"],
    theme = "soft"
)

demo.launch()