File size: 1,061 Bytes
31726e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import gradio as gr

# Define the function to run the command
def run_command(concept, word, letter):
    # Add your logic here for generating the image and saving the filename
    # Example placeholders:
    generated_image_path = "generated_image.png"  # Path to the generated image
    saved_filename = f"{concept}_{word}_{letter}.png"  # Example saved filename
    return generated_image_path, saved_filename

# Create the Gradio interface
ui = gr.Interface(
    fn=run_command,
    inputs=[
        gr.Textbox(label="Prompt Semantic Concept", placeholder="Enter a semantic concept, e.g., FLOWER"),
        gr.Textbox(label="Prompt Word", placeholder="Enter a word, e.g., FLOWER"),
        gr.Textbox(label="Prompt Letter", placeholder="Enter a letter, e.g., O")
    ],
    outputs=[
        gr.Image(label="Generated Image"),
        gr.Textbox(label="Saved Filename")
    ],
    title="Stable Diffusion Texture Generator",
    description="Enter a semantic concept, word, and letter to generate a texture image."
)

# Launch the UI
ui.launch(debug=True)