daasd commited on
Commit
d553a2f
·
1 Parent(s): 8de0048

Update main3.py

Browse files
Files changed (1) hide show
  1. main3.py +18 -17
main3.py CHANGED
@@ -305,24 +305,25 @@ css_content = '''
305
  with open(f'{params["dir"]}/style.css', 'a') as cssFile:
306
  cssFile.write(css_content)
307
  # png_info脚本
308
- subprocess.run([wget_path, '-O', f'{params["dir"]}/javascript/piw.js',
309
- 'https://huggingface.co/datasets/daasd/sd_backup/resolve/main/PNG_info_web.js'],
310
- check=True)
311
- # 拦截png_info
312
- with open(f'{params["dir"]}/modules/ui.py', 'r') as readFile:
313
- content = readFile.read()
314
- content = content.replace(''' for tabname, button in buttons.items():
315
- parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(
316
- paste_button=button, tabname=tabname, source_text_component=generation_info, source_image_component=image,
317
- ))
 
318
 
319
- image.change(
320
- fn=wrap_gradio_call(modules.extras.run_pnginfo),
321
- inputs=[image],
322
- outputs=[html, generation_info, html2],
323
- )''', '')
324
- with open(f'{params["dir"]}/modules/ui.py', 'w') as writeFile:
325
- writeFile.write(content)
326
 
327
  # 11.11 httpx依赖更新
328
  # 读取文件内容
 
305
  with open(f'{params["dir"]}/style.css', 'a') as cssFile:
306
  cssFile.write(css_content)
307
  # png_info脚本
308
+ if params["ui"] == "AUTOMATIC1111原版v1.5.1":
309
+ subprocess.run([wget_path, '-O', f'{params["dir"]}/javascript/piw.js',
310
+ 'https://huggingface.co/datasets/daasd/sd_backup/resolve/main/PNG_info_web.js'],
311
+ check=True)
312
+ # 拦截png_info
313
+ with open(f'{params["dir"]}/modules/ui.py', 'r') as readFile:
314
+ content = readFile.read()
315
+ content = content.replace(''' for tabname, button in buttons.items():
316
+ parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(
317
+ paste_button=button, tabname=tabname, source_text_component=generation_info, source_image_component=image,
318
+ ))
319
 
320
+ image.change(
321
+ fn=wrap_gradio_call(modules.extras.run_pnginfo),
322
+ inputs=[image],
323
+ outputs=[html, generation_info, html2],
324
+ )''', '')
325
+ with open(f'{params["dir"]}/modules/ui.py', 'w') as writeFile:
326
+ writeFile.write(content)
327
 
328
  # 11.11 httpx依赖更新
329
  # 读取文件内容