Spaces:
Runtime error
Runtime error
modify the interface design.
Browse files- app.py +10 -6
- config_cuda.yaml +0 -88
- config_cuda_ema.yaml → config_ema.yaml +0 -0
app.py
CHANGED
|
@@ -113,7 +113,9 @@ with block:
|
|
| 113 |
with gr.Row():
|
| 114 |
gr.Markdown(description)
|
| 115 |
only_show_rendered_image = gr.Number(value=1, visible=False)
|
| 116 |
-
|
|
|
|
|
|
|
| 117 |
with gr.Column():
|
| 118 |
|
| 119 |
with gr.Row():
|
|
@@ -122,11 +124,13 @@ with block:
|
|
| 122 |
exec(f"""rendered_txt_{i} = gr.Textbox(label=f"Render Text {i+1}")""")
|
| 123 |
|
| 124 |
with gr.Accordion(f"Advanced options {i+1}", open=False):
|
| 125 |
-
exec(f"""width_{i} = gr.Slider(label="Bbox Width", minimum=0., maximum=1, value=
|
| 126 |
exec(f"""ratio_{i} = gr.Slider(label="Bbox_width_height_ratio", minimum=0., maximum=5, value=0., step=0.02, visible=False) """)
|
| 127 |
-
exec(f"""top_left_x_{i} = gr.Slider(label="Bbox Top Left x", minimum=0., maximum=1, value={0.35 - 0.25 * math.cos(math.pi * i)}, step=0.01) """)
|
| 128 |
-
exec(f"""top_left_y_{i} = gr.Slider(label="Bbox Top Left y", minimum=0., maximum=1, value={0.1 if i < 2 else 0.6}, step=0.01) """)
|
| 129 |
-
exec(f"""
|
|
|
|
|
|
|
| 130 |
# exec(f"""num_rows_{i} = gr.Slider(label="num_rows", minimum=1, maximum=4, value=1, step=1, visible=False) """)
|
| 131 |
exec(f"""num_rows_{i} = gr.Slider(label="num_rows", minimum=1, maximum=4, value=1, step=1) """)
|
| 132 |
|
|
@@ -134,8 +138,8 @@ with block:
|
|
| 134 |
with gr.Column():
|
| 135 |
shared_prompt = gr.Textbox(label="Shared Prompt")
|
| 136 |
with gr.Row():
|
| 137 |
-
run_button = gr.Button(value="Run")
|
| 138 |
show_render_button = gr.Button(value="Only Rendered")
|
|
|
|
| 139 |
with gr.Accordion("Model Options", open=False):
|
| 140 |
with gr.Row():
|
| 141 |
# model_ckpt = gr.inputs.Dropdown(["LAION-Glyph-10M", "Textcaps5K-10"], label="Checkpoint", default = "LAION-Glyph-10M")
|
|
|
|
| 113 |
with gr.Row():
|
| 114 |
gr.Markdown(description)
|
| 115 |
only_show_rendered_image = gr.Number(value=1, visible=False)
|
| 116 |
+
default_width = [0.3, 0.3, 0.3, 0.3]
|
| 117 |
+
default_top_left_x = [0.35, 0.15, 0.15, 0.5]
|
| 118 |
+
default_top_left_y = [0.5, 0.25, 0.75, 0.75]
|
| 119 |
with gr.Column():
|
| 120 |
|
| 121 |
with gr.Row():
|
|
|
|
| 124 |
exec(f"""rendered_txt_{i} = gr.Textbox(label=f"Render Text {i+1}")""")
|
| 125 |
|
| 126 |
with gr.Accordion(f"Advanced options {i+1}", open=False):
|
| 127 |
+
exec(f"""width_{i} = gr.Slider(label="Bbox Width", minimum=0., maximum=1, value={default_width[i]}, step=0.01) """)
|
| 128 |
exec(f"""ratio_{i} = gr.Slider(label="Bbox_width_height_ratio", minimum=0., maximum=5, value=0., step=0.02, visible=False) """)
|
| 129 |
+
# exec(f"""top_left_x_{i} = gr.Slider(label="Bbox Top Left x", minimum=0., maximum=1, value={0.35 - 0.25 * math.cos(math.pi * i)}, step=0.01) """)
|
| 130 |
+
# exec(f"""top_left_y_{i} = gr.Slider(label="Bbox Top Left y", minimum=0., maximum=1, value={0.1 if i < 2 else 0.6}, step=0.01) """)
|
| 131 |
+
exec(f"""top_left_x_{i} = gr.Slider(label="Bbox Top Left x", minimum=0., maximum=1, value={default_top_left_x[i]}, step=0.01) """)
|
| 132 |
+
exec(f"""top_left_y_{i} = gr.Slider(label="Bbox Top Left y", minimum=0., maximum=1, value={default_top_left_y[i]}, step=0.01) """)
|
| 133 |
+
exec(f"""yaw_{i} = gr.Slider(label="Bbox Yaw", minimum=-20, maximum=20, value=0, step=5) """)
|
| 134 |
# exec(f"""num_rows_{i} = gr.Slider(label="num_rows", minimum=1, maximum=4, value=1, step=1, visible=False) """)
|
| 135 |
exec(f"""num_rows_{i} = gr.Slider(label="num_rows", minimum=1, maximum=4, value=1, step=1) """)
|
| 136 |
|
|
|
|
| 138 |
with gr.Column():
|
| 139 |
shared_prompt = gr.Textbox(label="Shared Prompt")
|
| 140 |
with gr.Row():
|
|
|
|
| 141 |
show_render_button = gr.Button(value="Only Rendered")
|
| 142 |
+
run_button = gr.Button(value="Run")
|
| 143 |
with gr.Accordion("Model Options", open=False):
|
| 144 |
with gr.Row():
|
| 145 |
# model_ckpt = gr.inputs.Dropdown(["LAION-Glyph-10M", "Textcaps5K-10"], label="Checkpoint", default = "LAION-Glyph-10M")
|
config_cuda.yaml
DELETED
|
@@ -1,88 +0,0 @@
|
|
| 1 |
-
model:
|
| 2 |
-
base_learning_rate: 1.0e-6 #1.0e-5 #1.0e-4
|
| 3 |
-
target: cldm.cldm.ControlLDM
|
| 4 |
-
params:
|
| 5 |
-
linear_start: 0.00085
|
| 6 |
-
linear_end: 0.0120
|
| 7 |
-
num_timesteps_cond: 1
|
| 8 |
-
log_every_t: 200
|
| 9 |
-
timesteps: 1000
|
| 10 |
-
first_stage_key: "jpg"
|
| 11 |
-
cond_stage_key: "txt"
|
| 12 |
-
control_key: "hint"
|
| 13 |
-
image_size: 64
|
| 14 |
-
channels: 4
|
| 15 |
-
cond_stage_trainable: false
|
| 16 |
-
conditioning_key: crossattn
|
| 17 |
-
monitor: #val/loss_simple_ema
|
| 18 |
-
scale_factor: 0.18215
|
| 19 |
-
only_mid_control: False
|
| 20 |
-
sd_locked: True
|
| 21 |
-
use_ema: False #TODO: specify
|
| 22 |
-
|
| 23 |
-
control_stage_config:
|
| 24 |
-
target: cldm.cldm.ControlNet
|
| 25 |
-
params:
|
| 26 |
-
use_checkpoint: True
|
| 27 |
-
image_size: 32 # unused
|
| 28 |
-
in_channels: 4
|
| 29 |
-
hint_channels: 3
|
| 30 |
-
model_channels: 320
|
| 31 |
-
attention_resolutions: [ 4, 2, 1 ]
|
| 32 |
-
num_res_blocks: 2
|
| 33 |
-
channel_mult: [ 1, 2, 4, 4 ]
|
| 34 |
-
num_head_channels: 64 # need to fix for flash-attn
|
| 35 |
-
use_spatial_transformer: True
|
| 36 |
-
use_linear_in_transformer: True
|
| 37 |
-
transformer_depth: 1
|
| 38 |
-
context_dim: 1024
|
| 39 |
-
legacy: False
|
| 40 |
-
|
| 41 |
-
unet_config:
|
| 42 |
-
target: cldm.cldm.ControlledUnetModel
|
| 43 |
-
params:
|
| 44 |
-
use_checkpoint: True
|
| 45 |
-
image_size: 32 # unused
|
| 46 |
-
in_channels: 4
|
| 47 |
-
out_channels: 4
|
| 48 |
-
model_channels: 320
|
| 49 |
-
attention_resolutions: [ 4, 2, 1 ]
|
| 50 |
-
num_res_blocks: 2
|
| 51 |
-
channel_mult: [ 1, 2, 4, 4 ]
|
| 52 |
-
num_head_channels: 64 # need to fix for flash-attn
|
| 53 |
-
use_spatial_transformer: True
|
| 54 |
-
use_linear_in_transformer: True
|
| 55 |
-
transformer_depth: 1
|
| 56 |
-
context_dim: 1024
|
| 57 |
-
legacy: False
|
| 58 |
-
|
| 59 |
-
first_stage_config:
|
| 60 |
-
target: ldm.models.autoencoder.AutoencoderKL
|
| 61 |
-
params:
|
| 62 |
-
embed_dim: 4
|
| 63 |
-
monitor: val/rec_loss
|
| 64 |
-
ddconfig:
|
| 65 |
-
#attn_type: "vanilla-xformers"
|
| 66 |
-
double_z: true
|
| 67 |
-
z_channels: 4
|
| 68 |
-
resolution: 256
|
| 69 |
-
in_channels: 3
|
| 70 |
-
out_ch: 3
|
| 71 |
-
ch: 128
|
| 72 |
-
ch_mult:
|
| 73 |
-
- 1
|
| 74 |
-
- 2
|
| 75 |
-
- 4
|
| 76 |
-
- 4
|
| 77 |
-
num_res_blocks: 2
|
| 78 |
-
attn_resolutions: []
|
| 79 |
-
dropout: 0.0
|
| 80 |
-
lossconfig:
|
| 81 |
-
target: torch.nn.Identity
|
| 82 |
-
|
| 83 |
-
cond_stage_config:
|
| 84 |
-
target: ldm.modules.encoders.modules.FrozenOpenCLIPEmbedder
|
| 85 |
-
params:
|
| 86 |
-
freeze: True
|
| 87 |
-
layer: "penultimate"
|
| 88 |
-
# device: "cpu" #TODO: specify
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_cuda_ema.yaml → config_ema.yaml
RENAMED
|
File without changes
|