some clarifications.
Browse files
app.py
CHANGED
@@ -44,8 +44,11 @@ def format_size(num: int) -> str:
|
|
44 |
return f"{num_f:.1f}Y"
|
45 |
|
46 |
|
47 |
-
def format_output(pipeline_id, memory_mapping, controlnet_mapping=None, t2i_adapter_mapping=None):
|
48 |
-
|
|
|
|
|
|
|
49 |
|
50 |
if memory_mapping:
|
51 |
for component, memory in memory_mapping.items():
|
@@ -196,7 +199,7 @@ def get_component_wise_memory(
|
|
196 |
if selected_file is not None:
|
197 |
component_wise_memory[component] = selected_file.size
|
198 |
|
199 |
-
return format_output(pipeline_id, component_wise_memory, controlnet_mapping, t2_adapter_mapping)
|
200 |
|
201 |
|
202 |
with gr.Interface(
|
@@ -210,7 +213,7 @@ with gr.Interface(
|
|
210 |
gr.components.Textbox(lines=1, label="pipeline_id", info="Example: runwayml/stable-diffusion-v1-5"),
|
211 |
gr.components.Textbox(lines=1, label="controlnet_id", info="Example: lllyasviel/sd-controlnet-canny"),
|
212 |
gr.components.Textbox(lines=1, label="t2i_adapter_id", info="Example: TencentARC/t2iadapter_color_sd14v1"),
|
213 |
-
gr.components.Textbox(lines=1, label="hf_token", info="Pass this in case of private repositories."),
|
214 |
gr.components.Radio(
|
215 |
ALLOWED_VARIANTS,
|
216 |
label="variant",
|
|
|
44 |
return f"{num_f:.1f}Y"
|
45 |
|
46 |
|
47 |
+
def format_output(pipeline_id, memory_mapping, variant=None, controlnet_mapping=None, t2i_adapter_mapping=None):
|
48 |
+
if variant is None:
|
49 |
+
variant = "fp32"
|
50 |
+
|
51 |
+
markdown_str = f"## {pipeline_id} ({variant})\n"
|
52 |
|
53 |
if memory_mapping:
|
54 |
for component, memory in memory_mapping.items():
|
|
|
199 |
if selected_file is not None:
|
200 |
component_wise_memory[component] = selected_file.size
|
201 |
|
202 |
+
return format_output(pipeline_id, component_wise_memory, variant, controlnet_mapping, t2_adapter_mapping)
|
203 |
|
204 |
|
205 |
with gr.Interface(
|
|
|
213 |
gr.components.Textbox(lines=1, label="pipeline_id", info="Example: runwayml/stable-diffusion-v1-5"),
|
214 |
gr.components.Textbox(lines=1, label="controlnet_id", info="Example: lllyasviel/sd-controlnet-canny"),
|
215 |
gr.components.Textbox(lines=1, label="t2i_adapter_id", info="Example: TencentARC/t2iadapter_color_sd14v1"),
|
216 |
+
gr.components.Textbox(lines=1, label="hf_token", info="Pass this in case of private/gated repositories."),
|
217 |
gr.components.Radio(
|
218 |
ALLOWED_VARIANTS,
|
219 |
label="variant",
|