Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
from diffusers import StableDiffusionPipeline
|
| 2 |
-
import torch
|
| 3 |
import gradio
|
| 4 |
import accelerate
|
| 5 |
|
|
@@ -31,15 +29,16 @@ def process1(prompt):
|
|
| 31 |
for i in range(len(models)):
|
| 32 |
if prompt.find(models[i].prefix)!=-1:
|
| 33 |
modelSelected=models[i].path
|
| 34 |
-
gradio.Interface.load(modelSelected)
|
| 35 |
if (modelSelected==''):
|
| 36 |
modelSelected = "models/stabilityai/stable-diffusion-2-1"
|
| 37 |
-
gradio.Interface.load(modelSelected)
|
| 38 |
-
|
|
|
|
| 39 |
return image_return
|
| 40 |
|
| 41 |
sandbox = gradio.Interface(fn=process1,
|
| 42 |
inputs=[gradio.Textbox(label="Enter Prompt:")],
|
| 43 |
outputs=[gradio.Image(label="Produced Image")],
|
| 44 |
title='AlStable Text to Image')
|
| 45 |
-
sandbox.queue(concurrency_count=20).launch()
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio
|
| 2 |
import accelerate
|
| 3 |
|
|
|
|
| 29 |
for i in range(len(models)):
|
| 30 |
if prompt.find(models[i].prefix)!=-1:
|
| 31 |
modelSelected=models[i].path
|
| 32 |
+
m=gradio.Interface.load(modelSelected)
|
| 33 |
if (modelSelected==''):
|
| 34 |
modelSelected = "models/stabilityai/stable-diffusion-2-1"
|
| 35 |
+
m=gradio.Interface.load(modelSelected)
|
| 36 |
+
print(modelSelected)
|
| 37 |
+
image_return = m(prompt)
|
| 38 |
return image_return
|
| 39 |
|
| 40 |
sandbox = gradio.Interface(fn=process1,
|
| 41 |
inputs=[gradio.Textbox(label="Enter Prompt:")],
|
| 42 |
outputs=[gradio.Image(label="Produced Image")],
|
| 43 |
title='AlStable Text to Image')
|
| 44 |
+
sandbox.queue(concurrency_count=20).launch()
|