File size: 899 Bytes
109b516
 
2851543
89303e0
2851543
 
af770ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109b516
 
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


st.title("👋 Hello Coders at MVP")
st.write("Welcome to your Hugging Face Space!")


import torch
from diffusers import DiffusionPipeline

@st.cache_resource
def load_pipe():
    pipe = DiffusionPipeline.from_pretrained(
        "stabilityai/stable-diffusion-xl-base-1.0",
        torch_dtype=torch.float16,
        variant="fp16",
        use_safetensors=True
    ).to("cuda")
    pipe.load_lora_weights("ZB-Tech/Text-to-Image")
    return pipe

st.title("🎨 AI Image Generator")
prompt = st.text_input("Enter a prompt:", "Draw a picture of some coding on a screen with a horror background")

if st.button("Generate"):
    with st.spinner("Generating image..."):
        pipe = load_pipe()
        image = pipe(prompt).images[0]
        st.image(image, caption="Generated Image", use_column_width=True)


x = st.slider('Select a value')
st.write(x, 'squared is', x * x)