|
import streamlit as st
|
|
from diffusers import DiffusionPipeline
|
|
from PIL import Image
|
|
|
|
|
|
pipe = DiffusionPipeline.from_pretrained("PRAMAY3000/floor-plan-generation")
|
|
|
|
|
|
st.title("Floor Plan Generator")
|
|
st.write("Create a floor plan based on your description!")
|
|
|
|
|
|
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"):
|
|
|
|
image = pipe(prompt).images[0]
|
|
|
|
|
|
st.image(image, caption="Generated Floor Plan", use_column_width=True)
|
|
|
|
|
|
image_path = "generated_floor_plan.png"
|
|
image.save(image_path)
|
|
|
|
|
|
st.download_button(
|
|
label="Download Floor Plan",
|
|
data=open(image_path, "rb").read(),
|
|
file_name=image_path,
|
|
mime="image/png"
|
|
)
|
|
|