BlockDetail commited on
Commit
487acfb
1 Parent(s): 23f02ce
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -34,7 +34,7 @@ with gr.Blocks() as demo:
34
  with gr.Row():
35
  with gr.Column():
36
  with gr.Row():
37
- stroke_type = gr.Radio(["Blocking", "Detail"], value="Detail", label="Stroke Type"),
38
  dilation_strength = gr.Slider(7, 117, value=65, step=2, label="Dilation Strength"),
39
  canvas = gr.Sketchpad(label="Sketch", sources=(), width=512, brush = gr.Brush(colors=["#000000"], default_size = 2, color_mode="fixed"), height=512)
40
  prompt_box = gr.Textbox(label="Prompt")
@@ -132,12 +132,12 @@ with gr.Blocks() as demo:
132
  sketch_states[k] = [None, None]
133
  return None, sketch_states
134
 
135
- def change_color(stroke_type):
136
- if stroke_type == "Blocking":
137
- color = "#00FF00"
138
- else:
139
- color = "#000000"
140
- return gr.Sketchpad(sources = (), width=512, brush = gr.Brush(colors=[color], default_size = 2, color_mode="fixed"), height=512)
141
 
142
  def change_background(option):
143
  global all_gens
@@ -159,7 +159,7 @@ with gr.Blocks() as demo:
159
 
160
  btn.click(run_sketching, [prompt_box, canvas, sketch_states, dilation_strength[0]], [gallery0, gallery1, gallery2, gallery3])
161
  btn2.click(reset, sketch_states, [canvas, sketch_states])
162
- stroke_type[0].change(change_color, [stroke_type[0]], canvas)
163
  num_samples[0].change(change_num_samples, [num_samples[0]], None)
164
 
165
  load()
 
34
  with gr.Row():
35
  with gr.Column():
36
  with gr.Row():
37
+ gr.Textbox(label="Stroke Type", value="To sketch Blocking strokes, change brush color to green. To sketch Detail strokes, change brush color to black."),
38
  dilation_strength = gr.Slider(7, 117, value=65, step=2, label="Dilation Strength"),
39
  canvas = gr.Sketchpad(label="Sketch", sources=(), width=512, brush = gr.Brush(colors=["#000000"], default_size = 2, color_mode="fixed"), height=512)
40
  prompt_box = gr.Textbox(label="Prompt")
 
132
  sketch_states[k] = [None, None]
133
  return None, sketch_states
134
 
135
+ # def change_color(stroke_type):
136
+ # if stroke_type == "Blocking":
137
+ # color = "#00FF00"
138
+ # else:
139
+ # color = "#000000"
140
+ # return gr.Sketchpad(sources = (), width=512, brush = gr.Brush(colors=[color], default_size = 2, color_mode="fixed"), height=512)
141
 
142
  def change_background(option):
143
  global all_gens
 
159
 
160
  btn.click(run_sketching, [prompt_box, canvas, sketch_states, dilation_strength[0]], [gallery0, gallery1, gallery2, gallery3])
161
  btn2.click(reset, sketch_states, [canvas, sketch_states])
162
+ # stroke_type[0].change(change_color, [stroke_type[0]], canvas)
163
  num_samples[0].change(change_num_samples, [num_samples[0]], None)
164
 
165
  load()