Skip to content

Commit bb52b38

Browse files
committed
Update api.py
1 parent ffa155c commit bb52b38

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

modules/api/api.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -1000,12 +1000,12 @@ def invocations(self, req: models.InvocationsRequest):
10001000
print("\n")
10011001
print("\n")
10021002
print(f"\n ----------------------------invocation log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} --------------------------- ")
1003-
# try:
1004-
# print("")
1005-
# self.req_logging(req)
1006-
# except Exception as e:
1007-
# print("console Log ran into issue: ", e)
1008-
# print(f"log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} req in invocations: {req}")
1003+
try:
1004+
print("")
1005+
self.req_logging(req)
1006+
except Exception as e:
1007+
print("console Log ran into issue: ", e)
1008+
print(f"log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} req in invocations: {req}")
10091009
global user_input_data
10101010
user_input_data = {}
10111011
# if 'alwayson_scripts' in req:
@@ -1085,6 +1085,14 @@ def invocations(self, req: models.InvocationsRequest):
10851085
elif req.task == 'image-to-image':
10861086
# response = requests.get('http://0.0.0.0:8080/controlnet/model_list', params={'update': True})
10871087
# print('Controlnet models: ', response.text)
1088+
response = requests.get('http://0.0.0.0:8080/sam/heartbeat')
1089+
print(f'\nsam/heartbeat: {response.text}\n')
1090+
response = requests.get('http://0.0.0.0:8080/sam/sam-model')
1091+
print(f'\nsam/sam-model: {response.text}\n')
1092+
1093+
global user_input_data
1094+
if user_input_data['workflow'] in ["style", "image"]:
1095+
print(f"In {user_input_data['workflow']}")
10881096

10891097
if embeddings_s3uri != '':
10901098
shared.s3_download(embeddings_s3uri, shared.cmd_opts.embeddings_dir)

0 commit comments

Comments
 (0)