File size: 1,201 Bytes
b9fa6d6
782f0cf
b9fa6d6
782f0cf
 
2af4736
 
782f0cf
2af4736
782f0cf
 
 
 
 
2af4736
782f0cf
2af4736
782f0cf
2af4736
 
782f0cf
 
 
 
 
2af4736
 
 
 
b9fa6d6
 
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 huggingface_hub import InferenceClient

# Aa Hugging Face na superfast computer no upyog karshe (Ekdam FREE)
client = InferenceClient("stabilityai/stable-diffusion-xl-base-1.0")

def generate_plan(prompt):
    # Perfect floor plan mate sacha keywords auto-add thashe
    full_prompt = f"{prompt}, architectural blueprint, 2D floor plan, CAD layout, black and white line art, professional design, highly detailed"
    try:
        image = client.text_to_image(full_prompt)
        return image
    except Exception as e:
        return None

# Tool nu Mast Design
with gr.Blocks() as demo:
    gr.Markdown("# 🏢 AI Architect Plan Generator (SUPER FAST)")
    with gr.Row():
        with gr.Column():
            input_text = gr.Textbox(
                label="Lakho kevo naksho joiye chhe (English ma):", 
                placeholder="e.g., 2BHK house floor plan, 1200 sq ft..."
            )
            submit_btn = gr.Button("Generate Plan Fast 🚀", variant="primary")
        with gr.Column():
            output_img = gr.Image(label="Tamaro AI Architect Plan:")
            
    submit_btn.click(fn=generate_plan, inputs=input_text, outputs=output_img)

demo.launch()