ngovanh commited on
Commit
5080c94
·
verified ·
1 Parent(s): 675a3a8

Update setup.py

Browse files
Files changed (1) hide show
  1. setup.py +9 -72
setup.py CHANGED
@@ -9,21 +9,18 @@ import json
9
  import sys
10
  import os
11
  import re
12
- import shutil
13
- import time
14
 
15
  SyS = get_ipython().system
16
  CD = os.chdir
17
  iRON = os.environ
18
 
19
- # [1] GIỮ NGUYÊN: ComfyUI v0.3.75
20
  REPO = {
21
  'A1111': 'https://github.com/gutris1/A1111',
22
  'Forge': 'https://github.com/lllyasviel/stable-diffusion-webui-forge Forge',
23
  'ReForge': '-b main-old https://github.com/Panchovix/stable-diffusion-webui-reForge ReForge',
24
  'Forge-Classic': 'https://github.com/Haoming02/sd-webui-forge-classic Forge-Classic',
25
  'Forge-Neo': '-b neo https://github.com/Haoming02/sd-webui-forge-classic Forge-Neo',
26
- 'ComfyUI': '-b v0.3.75 https://github.com/comfyanonymous/ComfyUI ComfyUI',
27
  'SwarmUI': 'https://github.com/mcmonkeyprojects/SwarmUI'
28
  }
29
 
@@ -234,7 +231,7 @@ def sym_link(U, M):
234
  'links': [
235
  (TMP / 'ckpt', M / 'checkpoints/tmp_ckpt'),
236
  (TMP / 'lora', M / 'loras/tmp_lora'),
237
- (TMP / 'controlnet', M / 'ControlNet'),
238
  (TMP / 'clip', M / 'clip'),
239
  (TMP / 'clip_vision', M / 'clip_vision'),
240
  (TMP / 'diffusers', M / 'diffusers'),
@@ -252,7 +249,7 @@ def sym_link(U, M):
252
  'links': [
253
  (TMP / 'ckpt', M / 'Stable-Diffusion/tmp_ckpt'),
254
  (TMP / 'lora', M / 'Lora/tmp_lora'),
255
- (TMP / 'controlnet', M / 'ControlNet'),
256
  (TMP / 'clip', M / 'clip'),
257
  (TMP / 'unet', M / 'unet')
258
  ]
@@ -287,6 +284,8 @@ def webui_req(U, W, M):
287
  f'https://github.com/gutris1/segsmaker/raw/main/script/KC/segsmaker.py {W}'
288
  ]
289
 
 
 
290
  for item in scripts: download(item)
291
 
292
  if U not in ['SwarmUI', 'ComfyUI']:
@@ -309,71 +308,7 @@ def webui_extension(U, W, M):
309
  say('<br><b>【{red} Installing Custom Nodes{d} 】{red}</b>')
310
  clone(str(W / 'asd/custom_nodes.txt'))
311
  print()
312
-
313
- # ----------------------------------------------------------------
314
- # [ULTIMATE FIX] XÓA SẠCH -> CÀI LẠI -> QUAY NGƯỢC THỜI GIAN
315
- # ----------------------------------------------------------------
316
-
317
- manager_path = EXT / 'ComfyUI-Manager'
318
-
319
- # 1. Xóa sạch sẽ thư mục Manager nếu tồn tại
320
- if manager_path.exists():
321
- print(f"🗑️ Đang xóa sạch thư mục ComfyUI-Manager tại {manager_path}...")
322
- try:
323
- shutil.rmtree(manager_path) # Xóa bằng python (nhanh hơn)
324
- except:
325
- SyS(f"rm -rf {manager_path}") # Xóa bằng lệnh hệ thống (dự phòng)
326
- time.sleep(2) # Đợi hệ thống xử lý xong
327
-
328
- # 2. Clone lại bản mới nhất (nhưng chưa dùng ngay)
329
- print(f"⬇️ Đang tải ComfyUI-Manager...")
330
- SyS(f"git clone https://github.com/ltdrdata/ComfyUI-Manager {manager_path}")
331
-
332
- # 3. QUAY NGƯỢC THỜI GIAN về tháng 07/2025 (Trước khi có Security V3)
333
- # Lệnh này sẽ tìm commit mới nhất trước ngày 01/07/2025 và chuyển về đó
334
- if (manager_path / '__init__.py').exists():
335
- print(f"🔙 Đang quay ngược phiên bản Manager về tháng 07/2025...")
336
- try:
337
- SyS(f"cd {manager_path} && git checkout $(git rev-list -n 1 --before='2025-07-01 00:00' main)")
338
- print(f"✅ Đã quay về phiên bản ổn định (Tháng 07/2025).")
339
- except Exception as e:
340
- print(f"⚠️ Không thể quay ngược phiên bản: {e}")
341
-
342
- # 4. Ghi file config 'weak' vào CẢ 2 VỊ TRÍ
343
- conf_content = """[default]
344
- preview_method = none
345
- git_exe =
346
- use_uv = True
347
- channel_url = https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main
348
- share_option = all
349
- bypass_ssl = False
350
- file_logging = True
351
- component_policy = workflow
352
- update_policy = stable-comfyui
353
- windows_selector_event_loop_policy = False
354
- model_download_by_agent = False
355
- downgrade_blacklist =
356
- security_level = weak
357
- always_lazy_install = False
358
- network_mode = public
359
- db_mode = cache
360
- """
361
- target_paths = [
362
- W / 'user/default/ComfyUI-Manager',
363
- manager_path
364
- ]
365
-
366
- for path in target_paths:
367
- try:
368
- path.mkdir(parents=True, exist_ok=True)
369
- (path / 'config.ini').write_text(conf_content)
370
- print(f"✅ Security Unlocked at: {path}")
371
- except:
372
- pass
373
- else:
374
- print(f"❌ LỖI NGHIÊM TRỌNG: Không thể tải ComfyUI-Manager. Vui lòng kiểm tra mạng.")
375
-
376
- # ----------------------------------------------------------------
377
 
378
  else:
379
  say('<br><b>【{red} Installing Extensions{d} 】{red}</b>')
@@ -387,6 +322,8 @@ def webui_installation(U, W):
387
 
388
  webui_req(U, W, M)
389
 
 
 
390
  if U != 'SwarmUI': webui_extension(U, W, M)
391
 
392
  def webui_selection(ui):
@@ -408,7 +345,7 @@ def webui_selection(ui):
408
  def webui_installer():
409
  branchs = {
410
  'A1111': 'master',
411
- # [3] GIỮ NGUYÊN: Tắt Auto-update cho ComfyUI
412
  'SwarmUI': 'master',
413
  'Forge': 'main',
414
  'ReForge': 'main',
 
9
  import sys
10
  import os
11
  import re
 
 
12
 
13
  SyS = get_ipython().system
14
  CD = os.chdir
15
  iRON = os.environ
16
 
 
17
  REPO = {
18
  'A1111': 'https://github.com/gutris1/A1111',
19
  'Forge': 'https://github.com/lllyasviel/stable-diffusion-webui-forge Forge',
20
  'ReForge': '-b main-old https://github.com/Panchovix/stable-diffusion-webui-reForge ReForge',
21
  'Forge-Classic': 'https://github.com/Haoming02/sd-webui-forge-classic Forge-Classic',
22
  'Forge-Neo': '-b neo https://github.com/Haoming02/sd-webui-forge-classic Forge-Neo',
23
+ 'ComfyUI': 'https://github.com/comfyanonymous/ComfyUI',
24
  'SwarmUI': 'https://github.com/mcmonkeyprojects/SwarmUI'
25
  }
26
 
 
231
  'links': [
232
  (TMP / 'ckpt', M / 'checkpoints/tmp_ckpt'),
233
  (TMP / 'lora', M / 'loras/tmp_lora'),
234
+ (TMP / 'controlnet', M / 'controlnet'),
235
  (TMP / 'clip', M / 'clip'),
236
  (TMP / 'clip_vision', M / 'clip_vision'),
237
  (TMP / 'diffusers', M / 'diffusers'),
 
249
  'links': [
250
  (TMP / 'ckpt', M / 'Stable-Diffusion/tmp_ckpt'),
251
  (TMP / 'lora', M / 'Lora/tmp_lora'),
252
+ (TMP / 'controlnet', M / 'controlnet'),
253
  (TMP / 'clip', M / 'clip'),
254
  (TMP / 'unet', M / 'unet')
255
  ]
 
284
  f'https://github.com/gutris1/segsmaker/raw/main/script/KC/segsmaker.py {W}'
285
  ]
286
 
287
+ # Removed upscalers list and download loop
288
+
289
  for item in scripts: download(item)
290
 
291
  if U not in ['SwarmUI', 'ComfyUI']:
 
308
  say('<br><b>【{red} Installing Custom Nodes{d} 】{red}</b>')
309
  clone(str(W / 'asd/custom_nodes.txt'))
310
  print()
311
+ # Removed face restore models (CodeFormer/GFPGAN) download loop
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
 
313
  else:
314
  say('<br><b>【{red} Installing Extensions{d} 】{red}</b>')
 
322
 
323
  webui_req(U, W, M)
324
 
325
+ # Removed extras download (embeddingsXL, VAE) and unzip command
326
+
327
  if U != 'SwarmUI': webui_extension(U, W, M)
328
 
329
  def webui_selection(ui):
 
345
  def webui_installer():
346
  branchs = {
347
  'A1111': 'master',
348
+ 'ComfyUI': 'master',
349
  'SwarmUI': 'master',
350
  'Forge': 'main',
351
  'ReForge': 'main',