File size: 645 Bytes
361b426
 
 
 
f68b950
 
 
3c51751
361b426
 
 
 
f68b950
361b426
 
 
f68b950
 
 
 
 
 
361b426
 
 
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
import streamlit as st
from diffusers import StableDiffusionPipeline
import torch

# Load the model
repo = "IDKiro/sdxs-512-0.9"
seed = 42
pipe = StableDiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float32)

# Streamlit app
st.title("Image generation demo")

prompt = st.text_input("Enter a text prompt:", "A gold ring")

if st.button("Generate Image"):
    # Generate image from the prompt
    image = pipe(
        prompt, 
        num_inference_steps=1, 
        guidance_scale=0,
        generator=torch.manual_seed(seed)
    ).images[0]
    
    # Display the image
    st.image(image, caption="Generated Image", channels="RGB")