M3000j's picture
Upload folder using huggingface_hub
31726e5 verified
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)