Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,17 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from diffusers import StableDiffusionPipeline
|
| 3 |
|
| 4 |
+
text2img = StableDiffusionPipeline.from_pretrained("Mitsua/mitsua-diffusion-one")
|
| 5 |
+
text2img.safety_checker=None # It is practically impossible for Mitsua to generate NSFW images
|
| 6 |
+
|
| 7 |
+
def predict(text):
|
| 8 |
+
return image = text2img(text).images[0]
|
| 9 |
+
|
| 10 |
+
demo = gr.Interface(
|
| 11 |
+
fn=predict,
|
| 12 |
+
inputs='text',
|
| 13 |
+
outputs='image',
|
| 14 |
+
)
|
| 15 |
+
demo.launch()
|
| 16 |
+
|
| 17 |
+
#gr.Interface.load("models/Mitsua/mitsua-diffusion-one").launch()
|