Spaces:
Sleeping
Sleeping
update
Browse files- app.py +3 -3
- inference.py +6 -6
app.py
CHANGED
@@ -122,9 +122,9 @@ def create_inference_demo(func: inference_fn) -> gr.Blocks:
|
|
122 |
with gr.Column():
|
123 |
result = gr.Image(label='Result')
|
124 |
|
125 |
-
reload_button.click(fn=reload_custom_diffusion_weight_list,
|
126 |
-
|
127 |
-
|
128 |
prompt.submit(fn=func,
|
129 |
inputs=[
|
130 |
model_id,
|
|
|
122 |
with gr.Column():
|
123 |
result = gr.Image(label='Result')
|
124 |
|
125 |
+
# reload_button.click(fn=reload_custom_diffusion_weight_list,
|
126 |
+
# inputs=None,
|
127 |
+
# outputs=weight_name)
|
128 |
prompt.submit(fn=func,
|
129 |
inputs=[
|
130 |
model_id,
|
inference.py
CHANGED
@@ -56,8 +56,8 @@ def inference_fn(
|
|
56 |
image_root_folder = os.path.join(model_id, 'inference')
|
57 |
os.makedirs(image_root_folder, exist_ok = True)
|
58 |
|
59 |
-
if prompt is None and args.template_name is None:
|
60 |
-
|
61 |
|
62 |
# single text prompt
|
63 |
if prompt is not None:
|
@@ -65,9 +65,9 @@ def inference_fn(
|
|
65 |
else:
|
66 |
prompt_list = []
|
67 |
|
68 |
-
if args.template_name is not None:
|
69 |
-
|
70 |
-
|
71 |
|
72 |
for prompt in prompt_list:
|
73 |
# insert relation prompt <R>
|
@@ -93,4 +93,4 @@ def inference_fn(
|
|
93 |
return image_grid
|
94 |
|
95 |
if __name__ == "__main__":
|
96 |
-
|
|
|
56 |
image_root_folder = os.path.join(model_id, 'inference')
|
57 |
os.makedirs(image_root_folder, exist_ok = True)
|
58 |
|
59 |
+
# if prompt is None and args.template_name is None:
|
60 |
+
# raise ValueError("please input a single prompt through'--prompt' or select a batch of prompts using '--template_name'.")
|
61 |
|
62 |
# single text prompt
|
63 |
if prompt is not None:
|
|
|
65 |
else:
|
66 |
prompt_list = []
|
67 |
|
68 |
+
# if args.template_name is not None:
|
69 |
+
# # read the selected text prompts for generation
|
70 |
+
# prompt_list.extend(inference_templates[args.template_name])
|
71 |
|
72 |
for prompt in prompt_list:
|
73 |
# insert relation prompt <R>
|
|
|
93 |
return image_grid
|
94 |
|
95 |
if __name__ == "__main__":
|
96 |
+
inference_fn()
|