Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyongliang committed Mar 11, 2023
1 parent d6a61ab commit 86ce539
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,29 +146,29 @@
create_train_dreambooth_component = None
username = ''

response = requests.get(url=f'{api_endpoint}/sd/industrialmodel')
if response.status_code == 200:
industrial_model = response.text
else:
model_name = 'stable-diffusion-webui'
model_description = model_name
inputs = {
'model_algorithm': 'stable-diffusion-webui',
'model_name': model_name,
'model_description': model_description,
'model_extra': '{"visible": "false"}',
'model_samples': '',
'file_content': {
'data': [(lambda x: int(x))(x) for x in open(os.path.join(script_path, 'logo.ico'), 'rb').read()]
}
response = requests.get(url=f'{api_endpoint}/sd/industrialmodel')
if response.status_code == 200:
industrial_model = response.text
else:
model_name = 'stable-diffusion-webui'
model_description = model_name
inputs = {
'model_algorithm': 'stable-diffusion-webui',
'model_name': model_name,
'model_description': model_description,
'model_extra': '{"visible": "false"}',
'model_samples': '',
'file_content': {
'data': [(lambda x: int(x))(x) for x in open(os.path.join(script_path, 'logo.ico'), 'rb').read()]
}
}

response = requests.post(url=f'{api_endpoint}/industrialmodel', json = inputs)
if response.status_code == 200:
body = json.loads(response.text)
industrial_model = body['id']
else:
print(response.text)
response = requests.post(url=f'{api_endpoint}/industrialmodel', json = inputs)
if response.status_code == 200:
body = json.loads(response.text)
industrial_model = body['id']
else:
print(response.text)

def reload_hypernetworks():
from modules.hypernetworks import hypernetwork
Expand Down

0 comments on commit 86ce539

Please sign in to comment.