k-l-lambda commited on
Commit
0ad49ae
1 Parent(s): bdec242

app.py: refined a little.

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -125,16 +125,16 @@ CONTROLNET_DICT = dict(
125
  strength=1,
126
  preprocessor='openpose',
127
  ),
128
- depth=InstantIDControlnetUnit(
129
- model_name='controlnet-depth-sdxl-1.0',
130
- strength=1,
131
- preprocessor='depth',
132
- ),
133
  canny=InstantIDControlnetUnit(
134
  model_name='controlnet-canny-sdxl-1.0',
135
  strength=1,
136
  preprocessor='canny',
137
  ),
 
 
 
 
 
138
  lineart=InstantIDControlnetUnit(
139
  model_name='controlnet-softedge-sdxl-1.0',
140
  strength=1,
@@ -288,7 +288,7 @@ def generate_image (
288
  try:
289
  client = get_novita_client(novita_key1)
290
  prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
291
- prompt = prompt[:1024]
292
  #print('prompt:', prompt)
293
  #print('negative_prompt:', negative_prompt)
294
  #print('seed:', seed)
@@ -320,7 +320,9 @@ def generate_image (
320
  t = time()
321
  if t > last_check + 5:
322
  last_check = t
323
- print('progress:', t, x)
 
 
324
 
325
  res = client.instant_id(
326
  model_name=f'{model_name}.safetensors',
@@ -340,6 +342,8 @@ def generate_image (
340
  #response_image_type='jpeg', # wait for novita_client 0.5.1 to fix this argument
341
  callback=progress_,
342
  )
 
 
343
  except Exception as e:
344
  raise gr.Error(f'Error: {e}')
345
 
 
125
  strength=1,
126
  preprocessor='openpose',
127
  ),
 
 
 
 
 
128
  canny=InstantIDControlnetUnit(
129
  model_name='controlnet-canny-sdxl-1.0',
130
  strength=1,
131
  preprocessor='canny',
132
  ),
133
+ depth=InstantIDControlnetUnit(
134
+ model_name='controlnet-depth-sdxl-1.0',
135
+ strength=1,
136
+ preprocessor='depth',
137
+ ),
138
  lineart=InstantIDControlnetUnit(
139
  model_name='controlnet-softedge-sdxl-1.0',
140
  strength=1,
 
288
  try:
289
  client = get_novita_client(novita_key1)
290
  prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
291
+ prompt = prompt[:1024] or ' '
292
  #print('prompt:', prompt)
293
  #print('negative_prompt:', negative_prompt)
294
  #print('seed:', seed)
 
320
  t = time()
321
  if t > last_check + 5:
322
  last_check = t
323
+ print('progress:', t, x.task.status)
324
+
325
+ print('controlnet_selection:', controlnet_selection)
326
 
327
  res = client.instant_id(
328
  model_name=f'{model_name}.safetensors',
 
342
  #response_image_type='jpeg', # wait for novita_client 0.5.1 to fix this argument
343
  callback=progress_,
344
  )
345
+
346
+ print('task_id:', res.task.task_id)
347
  except Exception as e:
348
  raise gr.Error(f'Error: {e}')
349