drod75's picture
Update app.py
326f7fa verified
raw
history blame contribute delete
600 Bytes
import streamlit as st
from transformers import pipeline
from diffusers import DiffusionPipeline
import torch
st.title('Anime Character Generator')
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.enable_model_cpu_offload()
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
prompt = st.text_input('Enter a prompt for your Anime character: ')
# run iamge
images = pipe(prompt=prompt).images[0]
st.image(image)