RageshAntony commited on
Commit
920ac22
·
verified ·
1 Parent(s): e8ea8da
Files changed (1) hide show
  1. check_app.py +5 -2
check_app.py CHANGED
@@ -39,8 +39,9 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
39
  cur_prg = step_index / num_steps
40
  progress(cur_prg, desc=f"Step {step_index}/{num_steps}")
41
  return callback_kwargs
42
-
43
  if hasattr(pipe, "guidance_scale") and hasattr(pipe, "callback_on_step_end"):
 
44
  image = pipe(
45
  prompt,
46
  num_inference_steps=num_steps,
@@ -48,13 +49,14 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
48
  callback_on_step_end=callback,
49
  ).images[0]
50
  elif not hasattr(pipe, "callback_on_step_end") and hasattr(pipe, "guidance_scale"):
51
- print("NO callback_on_step_end")
52
  image = pipe(
53
  prompt,
54
  num_inference_steps=num_steps,
55
  guidance_scale=guidance_scale,
56
  ).images[0]
57
  elif hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
 
58
  image = pipe(
59
  prompt,
60
  num_inference_steps=num_steps,
@@ -62,6 +64,7 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
62
  callback_on_step_end=callback
63
  ).images[0]
64
  elif not hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
 
65
  image = pipe(
66
  prompt,
67
  num_inference_steps=num_steps,
 
39
  cur_prg = step_index / num_steps
40
  progress(cur_prg, desc=f"Step {step_index}/{num_steps}")
41
  return callback_kwargs
42
+ print(f"START GENR ")
43
  if hasattr(pipe, "guidance_scale") and hasattr(pipe, "callback_on_step_end"):
44
+ print("has callback_on_step_end and has guidance_scale")
45
  image = pipe(
46
  prompt,
47
  num_inference_steps=num_steps,
 
49
  callback_on_step_end=callback,
50
  ).images[0]
51
  elif not hasattr(pipe, "callback_on_step_end") and hasattr(pipe, "guidance_scale"):
52
+ print("NO callback_on_step_end and has guidance_scale")
53
  image = pipe(
54
  prompt,
55
  num_inference_steps=num_steps,
56
  guidance_scale=guidance_scale,
57
  ).images[0]
58
  elif hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
59
+ print(" has callback_on_step_end and NO guidance_scale")
60
  image = pipe(
61
  prompt,
62
  num_inference_steps=num_steps,
 
64
  callback_on_step_end=callback
65
  ).images[0]
66
  elif not hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
67
+ print("NO callback_on_step_end and NO guidance_scale")
68
  image = pipe(
69
  prompt,
70
  num_inference_steps=num_steps,