Skip to content

Commit

Permalink
fix issues with option loading
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyongliang committed Mar 11, 2023
1 parent 2bd01b7 commit d34905c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/api/api.py
Expand Up @@ -417,9 +417,12 @@ def invocations(self, req: InvocationsRequest):
api_endpoint = os.environ['api_endpoint']
response = requests.post(url=f'{api_endpoint}/sd/user', json=inputs)
if response.status_code == 200 and response.text != '':
shared.opts.data = json.loads(response.text)
with self.queue_lock:
sd_models.reload_model_weights()
try:
shared.opts.data = json.loads(json.loads(response.text))
with self.queue_lock:
sd_models.reload_model_weights()
except Exception as e:
print(e)

self.download_s3files(hypernetwork_s3uri, os.path.join(script_path, shared.cmd_opts.hypernetwork_dir))
hypernetworks.hypernetwork.load_hypernetwork(shared.opts.sd_hypernetwork)
Expand Down

0 comments on commit d34905c

Please sign in to comment.