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