Spaces:
Runtime error
Runtime error
Commit
·
c50efc8
1
Parent(s):
230cbd4
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from generate import
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
url =
|
| 6 |
return {"image": url}
|
| 7 |
|
| 8 |
inputs = [
|
|
@@ -16,7 +16,7 @@ inputs = [
|
|
| 16 |
|
| 17 |
outputs = gr.outputs.Image(type="pil")
|
| 18 |
|
| 19 |
-
interface = gr.Interface(
|
| 20 |
description="Enter a prompt and generate an image using this API.",
|
| 21 |
examples=[["A cat sitting on a chair"],
|
| 22 |
["A landscape with mountains and a lake"],
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from generate import generate
|
| 3 |
|
| 4 |
+
def generate_wrapper(prompt, seed=0, negative_prompt="", model="Deliberate", sampler="k_dpmpp_2s_a", steps=50):
|
| 5 |
+
url = generate(prompt, seed=seed, negative_prompt=negative_prompt, model=model, sampler=sampler, steps=steps)
|
| 6 |
return {"image": url}
|
| 7 |
|
| 8 |
inputs = [
|
|
|
|
| 16 |
|
| 17 |
outputs = gr.outputs.Image(type="pil")
|
| 18 |
|
| 19 |
+
interface = gr.Interface(generate_wrapper, inputs, outputs, title="Generate Images from Prompts",
|
| 20 |
description="Enter a prompt and generate an image using this API.",
|
| 21 |
examples=[["A cat sitting on a chair"],
|
| 22 |
["A landscape with mountains and a lake"],
|