Spaces:
Runtime error
Runtime error
Update app.py
Browse filesback to the drawing board
app.py
CHANGED
|
@@ -29,6 +29,8 @@ models = [
|
|
| 29 |
Model("SD21","models/stabilityai/stable-diffusion-2-1", "sd21 default style")
|
| 30 |
]
|
| 31 |
|
|
|
|
|
|
|
| 32 |
def selectModel(message):
|
| 33 |
message = message.lower()
|
| 34 |
for i in range(len(models)):
|
|
@@ -38,18 +40,18 @@ def selectModel(message):
|
|
| 38 |
return c_model
|
| 39 |
c_model=models[i].path
|
| 40 |
logging.warning('model selected = '+c_model)
|
| 41 |
-
return c_model
|
| 42 |
-
|
| 43 |
-
inputs_prompt = (gr.inputs.Textbox(label="Model"), gr.inputs.Textbox(label="Prompt"))
|
| 44 |
|
| 45 |
sandbox = gr.Interface.load(
|
| 46 |
fn= selectModel,
|
| 47 |
-
name=
|
| 48 |
-
|
| 49 |
-
|
| 50 |
description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
|
| 51 |
article=article,
|
| 52 |
api_key=API_KEY
|
| 53 |
)
|
| 54 |
|
|
|
|
|
|
|
| 55 |
sandbox.queue(concurrency_count=20).launch()
|
|
|
|
| 29 |
Model("SD21","models/stabilityai/stable-diffusion-2-1", "sd21 default style")
|
| 30 |
]
|
| 31 |
|
| 32 |
+
custom_model = "models/dreamlike-art/dreamlike-diffusion-1.0"
|
| 33 |
+
|
| 34 |
def selectModel(message):
|
| 35 |
message = message.lower()
|
| 36 |
for i in range(len(models)):
|
|
|
|
| 40 |
return c_model
|
| 41 |
c_model=models[i].path
|
| 42 |
logging.warning('model selected = '+c_model)
|
| 43 |
+
return c_model
|
|
|
|
|
|
|
| 44 |
|
| 45 |
sandbox = gr.Interface.load(
|
| 46 |
fn= selectModel,
|
| 47 |
+
name= custom_model,
|
| 48 |
+
title="""AlStable sandbox""",
|
| 49 |
+
inputs = gr.Textbox(label="Prompt", show_label=False, max_lines=2, placeholder="Enter your prompt", elem_id="input-prompt"),
|
| 50 |
description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
|
| 51 |
article=article,
|
| 52 |
api_key=API_KEY
|
| 53 |
)
|
| 54 |
|
| 55 |
+
logging.warning('model chosen = '+custom_model)
|
| 56 |
+
|
| 57 |
sandbox.queue(concurrency_count=20).launch()
|