Spaces:
Paused
Paused
nekoshadow
commited on
Commit
•
eb44497
1
Parent(s):
c500f11
Fix import issue
Browse files
app.py
CHANGED
@@ -118,7 +118,8 @@ def resize_inputs(image_input, crop_size):
|
|
118 |
# else:
|
119 |
# return Image.fromarray(np.zeros([sample_num*256,16*256,3],np.uint8))
|
120 |
|
121 |
-
def generate(pipe, image_input,
|
|
|
122 |
output = pipe(conditioning_image=image_input)
|
123 |
return output[target_index]
|
124 |
|
@@ -278,8 +279,7 @@ def run_demo():
|
|
278 |
# .success(fn=partial(update_guide, _USER_GUIDE2), outputs=[guide_text], queue=False)
|
279 |
|
280 |
# azimuth.render()
|
281 |
-
|
282 |
-
run_btn.click(partial(generate, pipe), inputs=[input_block, target_index], outputs=[output_block], queue=True)\
|
283 |
.success(fn=partial(update_guide, _USER_GUIDE3), outputs=[guide_text], queue=False)
|
284 |
|
285 |
demo.queue().launch(share=False, max_threads=80) # auth=("admin", os.environ['PASSWD'])
|
|
|
118 |
# else:
|
119 |
# return Image.fromarray(np.zeros([sample_num*256,16*256,3],np.uint8))
|
120 |
|
121 |
+
def generate(pipe, image_input, azimuth):
|
122 |
+
target_index = round(azimuth % 360 / 22.5)
|
123 |
output = pipe(conditioning_image=image_input)
|
124 |
return output[target_index]
|
125 |
|
|
|
279 |
# .success(fn=partial(update_guide, _USER_GUIDE2), outputs=[guide_text], queue=False)
|
280 |
|
281 |
# azimuth.render()
|
282 |
+
run_btn.click(partial(generate, pipe), inputs=[input_block, azimuth], outputs=[output_block], queue=True)\
|
|
|
283 |
.success(fn=partial(update_guide, _USER_GUIDE3), outputs=[guide_text], queue=False)
|
284 |
|
285 |
demo.queue().launch(share=False, max_threads=80) # auth=("admin", os.environ['PASSWD'])
|