File size: 1,007 Bytes
43899d2 |
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 33 |
import streamlit as st
from diffusers import DiffusionPipeline
from PIL import Image
# Modeli yükle
pipe = DiffusionPipeline.from_pretrained("PRAMAY3000/floor-plan-generation")
# Streamlit arayüzü
st.title("Floor Plan Generator")
st.write("Create a floor plan based on your description!")
# Kullanıcıdan girdi alın
prompt = st.text_input("Enter the description for the floor plan:", "2 rooms one living room architectural floor plan draw")
if st.button("Generate Floor Plan"):
# Görüntü oluştur
image = pipe(prompt).images[0]
# Görüntüyü göster
st.image(image, caption="Generated Floor Plan", use_column_width=True)
# Görüntüyü kaydetme
image_path = "generated_floor_plan.png"
image.save(image_path)
# Kullanıcıya dosya indirme linki sağla
st.download_button(
label="Download Floor Plan",
data=open(image_path, "rb").read(),
file_name=image_path,
mime="image/png"
)
|