Update app.py
Browse files
app.py
CHANGED
|
@@ -89,9 +89,33 @@ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
| 89 |
|
| 90 |
iface.launch()
|
| 91 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
def image_mod(image):
|
| 93 |
-
output1=proc11("full body sexy girl")
|
| 94 |
-
output1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
return(output1)
|
| 96 |
#return image.rotate(45)
|
| 97 |
|
|
@@ -110,6 +134,7 @@ demo = gr.Interface(
|
|
| 110 |
],
|
| 111 |
|
| 112 |
)
|
|
|
|
| 113 |
|
| 114 |
|
| 115 |
demo.launch()
|
|
|
|
| 89 |
|
| 90 |
iface.launch()
|
| 91 |
"""
|
| 92 |
+
state_info = gr.Textbox(label="State", show_label=False, max_lines=2).style(container=False)
|
| 93 |
+
|
| 94 |
+
def update_state_info(old_state):
|
| 95 |
+
if state and state != old_state:
|
| 96 |
+
return gr.update(value=state)
|
| 97 |
+
|
| 98 |
+
def update_state(new_state):
|
| 99 |
+
global state
|
| 100 |
+
state = new_state
|
| 101 |
+
|
| 102 |
+
def pipe_callback(step: int, timestep: int, latents: torch.FloatTensor):
|
| 103 |
+
update_state(f"{step}/{current_steps} steps")#\nTime left, sec: {timestep/100:.0f}")
|
| 104 |
+
|
| 105 |
+
|
| 106 |
def image_mod(image):
|
| 107 |
+
#output1=proc11("full body sexy girl")
|
| 108 |
+
output1 = proc11(
|
| 109 |
+
prompt="full body sexy girl",
|
| 110 |
+
negative_prompt = "bad anatomy",
|
| 111 |
+
num_images_per_prompt=1,
|
| 112 |
+
num_inference_steps = int(10),
|
| 113 |
+
guidance_scale = 25,
|
| 114 |
+
width = 512,
|
| 115 |
+
height = 800,
|
| 116 |
+
generator = 0,
|
| 117 |
+
callback=pipe_callback)
|
| 118 |
+
#output1.save("save001.png")
|
| 119 |
return(output1)
|
| 120 |
#return image.rotate(45)
|
| 121 |
|
|
|
|
| 134 |
],
|
| 135 |
|
| 136 |
)
|
| 137 |
+
demo.load(update_state_info, inputs=state_info, outputs=state_info, every=0.5, show_progress=False)
|
| 138 |
|
| 139 |
|
| 140 |
demo.launch()
|