|
|
import gradio as gr |
|
|
from PIL import Image |
|
|
import random |
|
|
|
|
|
|
|
|
def generate_design(mood_board, style_preference, complexity, color_tone): |
|
|
|
|
|
|
|
|
design_text = f"Generated a {style_preference} design with {color_tone} tones at complexity level {complexity}." |
|
|
design_image = Image.new("RGB", (512, 512), color=(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))) |
|
|
return design_image, design_text |
|
|
|
|
|
|
|
|
mood_board_input = gr.Image(type="pil", label="Upload Mood Board (optional)") |
|
|
style_preference_input = gr.Dropdown( |
|
|
choices=["Casual", "Formal", "Sporty", "Bohemian", "Avant-garde"], |
|
|
label="Style Preference" |
|
|
) |
|
|
complexity_input = gr.Slider(1, 10, step=1, label="Complexity Level") |
|
|
color_tone_input = gr.Radio( |
|
|
choices=["Bright", "Muted", "Neutral", "Pastel"], |
|
|
label="Color Tone" |
|
|
) |
|
|
|
|
|
outputs = [ |
|
|
gr.Image(label="Generated Fashion Design"), |
|
|
gr.Textbox(label="Design Details") |
|
|
] |
|
|
|
|
|
interface = gr.Interface( |
|
|
fn=generate_design, |
|
|
inputs=[mood_board_input, style_preference_input, complexity_input, color_tone_input], |
|
|
outputs=outputs, |
|
|
title="AI-Assisted Designer Tool", |
|
|
description="Generate unique fashion designs based on mood boards, style preferences, and other inputs." |
|
|
) |
|
|
|
|
|
|
|
|
interface.launch() |
|
|
|