camenduru commited on
Commit
bb154bd
1 Parent(s): cb8bfeb

Update worker_runpod.py

Browse files
Files changed (1) hide show
  1. worker_runpod.py +4 -5
worker_runpod.py CHANGED
@@ -83,7 +83,10 @@ def generate(input):
83
  }
84
  supported_tasks[args.task](args).run()
85
 
86
- result = "/content/result/diffbir_tost.png"
 
 
 
87
  try:
88
  notify_uri = values['notify_uri']
89
  del values['notify_uri']
@@ -136,10 +139,6 @@ def generate(input):
136
  pass
137
  return {"jobId": job_id, "result": f"FAILED: {str(e)}", "status": "FAILED"}
138
  finally:
139
- if os.path.exists(result):
140
- os.remove(result)
141
- if os.path.exists(input_image):
142
- os.remove(input_image)
143
  if os.path.exists('/content/input'):
144
  shutil.rmtree('/content/input')
145
  if os.path.exists('/content/result'):
 
83
  }
84
  supported_tasks[args.task](args).run()
85
 
86
+ if args.version == "fr_bg":
87
+ result = "/content/result/restored_backgrounds/diffbir_tost.png"
88
+ else:
89
+ result = "/content/result/diffbir_tost.png"
90
  try:
91
  notify_uri = values['notify_uri']
92
  del values['notify_uri']
 
139
  pass
140
  return {"jobId": job_id, "result": f"FAILED: {str(e)}", "status": "FAILED"}
141
  finally:
 
 
 
 
142
  if os.path.exists('/content/input'):
143
  shutil.rmtree('/content/input')
144
  if os.path.exists('/content/result'):