JoPmt commited on
Commit
768fc84
1 Parent(s): 0da8e39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -53,12 +53,15 @@ models =[
53
  "digiplay/PotoPhotoRealism_v1",
54
  ]
55
 
 
 
 
56
  def plex(prompt,modil):
57
  pipe = accelerator.prepare(AutoPipelineForText2Image.from_pretrained(""+modil+"", torch_dtype=torch.float32))
58
  pipe = accelerator.prepare(pipe.to("cpu"))
59
  image = pipe(prompt=prompt, num_inference_steps=10).images[0]
60
  return image
61
 
62
- iface = gr.Interface(fn=plex,outputs=gr.Image(label="Generated Output Image"),inputs=[gr.Dropdown(choices=models, type="value", value=models[random.randint(1, len(models))], gr.Textbox(label="Prompt"), gr.Textbox(label="negative_prompt", value="low quality, bad quality")])], title="AutoPipelineForText2Image_SD_Multi",description="AutoPipelineForText2Image_SD_Multi")
63
  iface.queue(max_size=1)
64
  iface.launch(max_threads=1)
 
53
  "digiplay/PotoPhotoRealism_v1",
54
  ]
55
 
56
+ bor = len(models)
57
+ current = random.randint(1, bor)
58
+
59
  def plex(prompt,modil):
60
  pipe = accelerator.prepare(AutoPipelineForText2Image.from_pretrained(""+modil+"", torch_dtype=torch.float32))
61
  pipe = accelerator.prepare(pipe.to("cpu"))
62
  image = pipe(prompt=prompt, num_inference_steps=10).images[0]
63
  return image
64
 
65
+ iface = gr.Interface(fn=plex,outputs=gr.Image(label="Generated Output Image"),inputs=[gr.Dropdown(choices=models, type="value", value=models[current]), gr.Textbox(label="Prompt"), gr.Textbox(label="negative_prompt", value="low quality, bad quality")])], title="AutoPipelineForText2Image_SD_Multi",description="AutoPipelineForText2Image_SD_Multi")
66
  iface.queue(max_size=1)
67
  iface.launch(max_threads=1)