AlStable commited on
Commit
2a90a2f
·
1 Parent(s): 80f43e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -29,10 +29,6 @@ models = [
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
- custom_model = "models/hakurei/waifu-diffusion-v1-3"
34
- """
35
-
36
  custom_model = "models/dreamlike-art/dreamlike-diffusion-1.0"
37
 
38
  def selectModel(message):
@@ -44,18 +40,17 @@ def selectModel(message):
44
  return c_model
45
  c_model=models[i].path
46
  logging.warning('model selected = '+c_model)
47
- return c_model
 
 
48
 
49
  sandbox = gr.Interface.load(
50
  fn= selectModel,
51
- name= custom_model,
52
- title="""AlStable sandbox""",
53
- inputs = gr.Textbox(label="Prompt", show_label=False, max_lines=2, placeholder="Enter your prompt", elem_id="input-prompt"),
54
  description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
55
  article=article,
56
  api_key=API_KEY
57
  )
58
 
59
- logging.warning('model chosen = '+custom_model)
60
-
61
  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):
 
40
  return c_model
41
  c_model=models[i].path
42
  logging.warning('model selected = '+c_model)
43
+ return c_model, prompt
44
+
45
+ inputs_prompt = (gr.inputs.Textbox(label="Model"), gr.inputs.Textbox(label="Prompt")
46
 
47
  sandbox = gr.Interface.load(
48
  fn= selectModel,
49
+ inputs=inputs_prompt
50
+ title=("""AlStable sandbox""","selectModel")
 
51
  description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
52
  article=article,
53
  api_key=API_KEY
54
  )
55
 
 
 
56
  sandbox.queue(concurrency_count=20).launch()