Alexander Bagus commited on
Commit
c4729b7
·
1 Parent(s): e39980f
Files changed (2) hide show
  1. app.py +6 -3
  2. static/header.html +1 -1
app.py CHANGED
@@ -10,7 +10,6 @@ from utils.image_utils import get_image_latent, scale_image
10
  from utils.prompt_utils import polish_prompt
11
  # from controlnet_aux import HEDdetector, MLSDdetector, OpenposeDetector, CannyDetector, MidasDetector
12
  from controlnet_aux.processor import Processor
13
- # from videox_fun.utils.utils import get_image_latent
14
 
15
 
16
  # MODEL_REPO = "Tongyi-MAI/Z-Image-Turbo"
@@ -95,6 +94,7 @@ def inference(
95
  progress=gr.Progress(track_tqdm=True),
96
  ):
97
  # process image
 
98
  if input_image is None:
99
  print("Error: input_image is empty.")
100
  return None
@@ -113,10 +113,13 @@ def inference(
113
  else:
114
  processor = Processor('canny')
115
 
116
- control_image, width, height = scale_image(input_image, image_scale, 64)
117
  control_image = control_image.resize((512, 512))
 
 
118
  control_image = processor(control_image, to_pil=True)
119
 
 
120
  control_image_torch = get_image_latent(control_image, sample_size=[height, width])[:, :, 0]
121
 
122
  # generation
@@ -227,8 +230,8 @@ with gr.Blocks(css=css) as demo:
227
  value=8,
228
  )
229
  gr.Examples(examples=examples, inputs=[input_image, prompt])
230
-
231
  gr.HTML(read_file("static/footer.html"))
 
232
  run_button.click(
233
  fn=prepare,
234
  inputs=prompt,
 
10
  from utils.prompt_utils import polish_prompt
11
  # from controlnet_aux import HEDdetector, MLSDdetector, OpenposeDetector, CannyDetector, MidasDetector
12
  from controlnet_aux.processor import Processor
 
13
 
14
 
15
  # MODEL_REPO = "Tongyi-MAI/Z-Image-Turbo"
 
94
  progress=gr.Progress(track_tqdm=True),
95
  ):
96
  # process image
97
+ print("DEBUG: process image")
98
  if input_image is None:
99
  print("Error: input_image is empty.")
100
  return None
 
113
  else:
114
  processor = Processor('canny')
115
 
116
+ control_image, width, height = scale_image(input_image, image_scale, 8)
117
  control_image = control_image.resize((512, 512))
118
+
119
+ print("DEBUG: processor running")
120
  control_image = processor(control_image, to_pil=True)
121
 
122
+ print("DEBUG: control_image_torch")
123
  control_image_torch = get_image_latent(control_image, sample_size=[height, width])[:, :, 0]
124
 
125
  # generation
 
230
  value=8,
231
  )
232
  gr.Examples(examples=examples, inputs=[input_image, prompt])
 
233
  gr.HTML(read_file("static/footer.html"))
234
+
235
  run_button.click(
236
  fn=prepare,
237
  inputs=prompt,
static/header.html CHANGED
@@ -8,6 +8,6 @@
8
  <br>
9
  Supports multiple control conditions - including Canny, HED, Depth, Pose and MLSD.
10
  <br>
11
- If you like my spaces, please support me by visiting <a href="https://aisudo.com/" target="_blank">AiSudo</a> for more image generation 😊
12
  </div>
13
  </div>
 
8
  <br>
9
  Supports multiple control conditions - including Canny, HED, Depth, Pose and MLSD.
10
  <br>
11
+ If you like my spaces, please support me by visiting <a href="https://aisudo.com/" target="_blank">AiSudo</a> 😊
12
  </div>
13
  </div>