Spaces:
Runtime error
Runtime error
shichen commited on
Commit ·
ccfa5a6
1
Parent(s): 7257002
更新key申请
Browse files36 unmodified lines37383940414243444546474849505152535455565736 unmodified lineswith gr.Blocks() as demo:with gr.Row():with gr.Column(scale=1):api_key = gr.Textbox(label="API Key")prompt = gr.Textbox(label="Prompt", placeholder="What you wish to see in the output image.")aspect_ratio = gr.Dropdown(label="Aspect Ratio", choices=["16:9", "1:1", "21:9", "2:3", "3:2", "4:5", "5:4", "9:16", "9:21"], value="1:1")model = gr.Dropdown(label="Model", choices=["sd3", "sd3-turbo"], value="sd3")negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="Describe what you do not wish to see.")seed = gr.Number(label="Seed", value=0, minimum=0, maximum=4294967294, step=1)generate_btn = gr.Button("Generate Image")# api_key_info = gr.Text("API Key Application", style="bold") # Text display# api_key_link = gr.Link("https://platform.stability.ai/account/keys", "Apply Here") # Hyperlinkwith gr.Column(scale=1):output = gr.Image()generate_btn.click(fn=generate_image,inputs=[api_key, prompt, aspect_ratio, model, negative_prompt, seed],outputs=output)demo.launch()36 unmodified lines373839404142434445464748495051525354555657585936 unmodified lineswith gr.Blocks() as demo:with gr.Row():with gr.Column(scale=1):api_key_text = gr.HTML("<a href='https://platform.stability.ai/account/keys' target='_blank'>点我申请API-key,免费运行6次</a>")api_key = gr.Textbox(label="API Key")prompt = gr.Textbox(label="Prompt", placeholder="What you wish to see in the output image.")aspect_ratio = gr.Dropdown(label="Aspect Ratio", choices=["16:9", "1:1", "21:9", "2:3", "3:2", "4:5", "5:4", "9:16", "9:21"], value="1:1")model = gr.Dropdown(label="Model", choices=["sd3", "sd3-turbo"], value="sd3")seed = gr.Number(label="Seed (输入0则随机种子)", value=0, minimum=0, maximum=4294967294, step=1)seed.description = "输入0则随机种子"negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="Describe what you do not wish to see.")generate_btn = gr.Button("Generate Image")with gr.Column(scale=1):output = gr.Image()generate_btn.click(fn=generate_image,inputs=[api_key, prompt, aspect_ratio, model, negative_prompt, seed],outputs=output)demo.launch(server_port=7855)
app.py+6-4