Spaces:
Runtime error
Runtime error
File size: 827 Bytes
7b994cc 67c97c9 7b994cc 6374fdd 7b994cc 8998b56 50ed3d2 7b994cc e9e469a 7b994cc 50ed3d2 7b994cc e9e469a 7b994cc | 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 | from diffusers import StableDiffusionPipeline
import torch
from transformers.utils.hub import move_cache
move_cache()
sdmodel=['stabilityai/stable-diffusion-2-1']
def T2I(Prompt,model):
model_id = model
pipe = StableDiffusionPipeline.from_pretrained(model_id)
pipe = pipe.to("cpu")
prompt = Prompt
image = pipe(prompt).images[0]
return image
desc = "The Models are running on Low processing power CPU'S. Which can take longer time to load!!!"
import gradio as gr
# css = ".gradio-container {background: rgb(0, 166, 228)}"
interface = gr.Interface(fn=T2I,
inputs=["text", gr.Dropdown(sdmodel)],
outputs="image",
title='Advanced Stable DiFFusion',
description=desc
)
interface.launch() |