dsh-qqbot-muu 0.1.15 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +168 -85
- package/client/qqbot-settings.js +13401 -12024
- package/config/modules.json +212 -0
- package/dist/channel-tools.js +21 -10
- package/dist/config.d.ts +14 -0
- package/dist/config.js +573 -449
- package/dist/features/contextless-store.js +247 -247
- package/dist/features/contextless-trim.js +455 -34
- package/dist/features/four-source.js +338 -336
- package/dist/features/group-join-request.js +289 -287
- package/dist/features/local-models.js +1494 -0
- package/dist/features/rotate-summarizer.js +438 -0
- package/dist/features/scenario-detect.js +321 -0
- package/dist/features/scheduler.js +8 -1
- package/dist/features/session-rotate.js +499 -0
- package/dist/features/session-title.js +199 -0
- package/dist/features/style-layer.js +501 -0
- package/dist/features/thinking-log.js +71 -69
- package/dist/gateway/bootstrap.js +1704 -1388
- package/dist/gateway/data-root.js +77 -3
- package/dist/gateway/middleware-setup.js +6 -3
- package/dist/index.js +4 -2
- package/dist/model/settings-reader.js +193 -102
- package/dist/session/session-manager.js +1730 -1587
- package/dist/shared/paths.js +128 -0
- package/dist/shared/settings-io.js +79 -0
- package/dist/transport/inbound.js +20 -1
- package/dist/transport/outbound.js +56 -4
- package/docs/RELEASE_CHECKLIST.md +24 -2
- package/dshqqbot/.qqbot-extensions/hooks/interview-panel.mjs +41 -1
- package/dshqqbot/.qqbot-extensions/inbound/00-vision.mjs +111 -0
- package/dshqqbot/.qqbot-extensions/inbound/aa-memory-recall.mjs +802 -689
- package/dshqqbot/.qqbot-extensions/inbound/ac-image-see.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/inbound/az-feedback.mjs +113 -115
- package/dshqqbot/.qqbot-extensions/inbound/local-answer.mjs +689 -568
- package/dshqqbot/.qqbot-extensions/lib/.pet-form.json +1 -1
- package/dshqqbot/.qqbot-extensions/lib/draw-core.mjs +238 -7
- package/dshqqbot/.qqbot-extensions/lib/local-llm.mjs +455 -394
- package/dshqqbot/.qqbot-extensions/lib/memory-agent.mjs +930 -928
- package/dshqqbot/.qqbot-extensions/lib/memory-core.mjs +537 -537
- package/dshqqbot/.qqbot-extensions/lib/memory-db.mjs +2476 -2245
- package/dshqqbot/.qqbot-extensions/lib/memory-hippo.mjs +18 -0
- package/dshqqbot/.qqbot-extensions/lib/memory.mjs +191 -186
- package/dshqqbot/.qqbot-extensions/lib/plugin-dir.mjs +14 -4
- package/dshqqbot/.qqbot-extensions/lib/scope-util.mjs +84 -0
- package/dshqqbot/.qqbot-extensions/lib/vision.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/outbound/aa-sanitize.mjs +158 -154
- package/dshqqbot/.qqbot-extensions/outbound/ac-media-fix.mjs +5 -1
- package/dshqqbot/.qqbot-extensions/outbound/memory-agent.mjs +121 -130
- package/dshqqbot/.qqbot-extensions/outbound/split-reply.mjs +18 -2
- package/dshqqbot/.qqbot-extensions/outbound/turn-memory.mjs +92 -101
- package/dshqqbot/.qqbot-extensions/tools/draw.mjs +22 -1
- package/dshqqbot/.qqbot-extensions/tools/memory.mjs +178 -120
- package/dshqqbot/.qqbot-extensions/tools/pet_card.mjs +3 -2
- package/dshqqbot/.qqbot-extensions/tools/storyboard.mjs +3 -1
- package/dshqqbot/.qqbot-extensions/vendor/abogus/test-abogus.mjs +128 -126
- package/package.json +119 -111
- package/scripts/__pycache__/fan-mode.cpython-311.pyc +0 -0
- package/scripts/__pycache__/memory-audit.cpython-311.pyc +0 -0
- package/scripts/__pycache__/qq-ip-sync.cpython-311.pyc +0 -0
- package/scripts/__pycache__/qq-whitelist.cpython-311.pyc +0 -0
- package/scripts/_add_maintenance_cfg.py +20 -0
- package/scripts/_bench_keeplease.sh +10 -0
- package/scripts/_dbg_purge.py +15 -0
- package/scripts/_elev.sh +6 -0
- package/scripts/_fix_all_admin.cmd +16 -0
- package/scripts/_livecheck-image.mjs +33 -0
- package/scripts/_livecheck-llm.mjs +34 -0
- package/scripts/_livecheck-tts.mjs +37 -0
- package/scripts/_patch_curve.py +88 -0
- package/scripts/_patch_fan_thermal.py +24 -0
- package/scripts/_tag_tmp.py +13 -0
- package/scripts/adb-broker-client.mjs +87 -0
- package/scripts/adb-broker.mjs +205 -0
- package/scripts/ai-mode.cmd +6 -0
- package/scripts/ai-mode.py +387 -0
- package/scripts/ai-toolkit.py +607 -0
- package/scripts/apply-fan-gpu45.py +51 -0
- package/scripts/bench-fans.py +515 -0
- package/scripts/bench-load-direct.py +63 -0
- package/scripts/boot-tasks-hidden.vbs +20 -0
- package/scripts/boot-tasks.cmd +277 -0
- package/scripts/chat-archive/__pycache__/build-sft-v4.cpython-311.pyc +0 -0
- package/scripts/chat-archive/__pycache__/build-sft.cpython-311.pyc +0 -0
- package/scripts/chat-archive/build-sft-v4.py +566 -0
- package/scripts/chat-archive/build-sft.py +390 -0
- package/scripts/chat-archive/eval-sft.py +155 -0
- package/scripts/chat-archive/extract-memory.py +143 -0
- package/scripts/chat-archive/inventory.py +182 -0
- package/scripts/chat-archive/merge-sft.py +114 -0
- package/scripts/chat-archive/qce-pull.py +217 -0
- package/scripts/chat-archive/qqheader.py +110 -0
- package/scripts/chat-archive/qqkey2.py +113 -0
- package/scripts/chat-archive/qqprobe.py +153 -0
- package/scripts/chat-archive/screen-collect.py +163 -0
- package/scripts/chat-archive/sqlcipher_probe.py +444 -0
- package/scripts/comfy_gen.py +209 -0
- package/scripts/compose-video.py +168 -0
- package/scripts/dl_models.py +45 -0
- package/scripts/draw-now.cmd +18 -0
- package/scripts/dsh-instance-guard.mjs +20 -2
- package/scripts/elev-extra.cmd +25 -0
- package/scripts/episode.py +529 -0
- package/scripts/fan-curve.py +218 -0
- package/scripts/fan-guard.cmd +8 -0
- package/scripts/fan-mode.py +380 -0
- package/scripts/fan_manual_safe.py +33 -0
- package/scripts/fan_restore_manual.py +46 -0
- package/scripts/fc_curves.py +359 -0
- package/scripts/fix-fan-and-timers.cmd +39 -0
- package/scripts/fix_admin_all.py +94 -0
- package/scripts/flows.mjs +224 -0
- package/scripts/gateway.cmd +126 -0
- package/scripts/gen-image.py +420 -0
- package/scripts/gen-video.py +186 -0
- package/scripts/git-askpass.cmd +2 -2
- package/scripts/gpu-mode.py +195 -0
- package/scripts/hw-profile.py +175 -0
- package/scripts/install-schedule.cmd +37 -0
- package/scripts/install-watch.cmd +29 -0
- package/scripts/matte-cutout.py +106 -0
- package/scripts/media-enhance.py +402 -0
- package/scripts/memory-audit.py +581 -0
- package/scripts/migrate-scope.mjs +140 -139
- package/scripts/model-registry.py +519 -0
- package/scripts/openid-audit.mjs +219 -0
- package/scripts/pull-gguf.py +127 -0
- package/scripts/purge-standby.py +151 -0
- package/scripts/qq-connect-login.py +133 -0
- package/scripts/qq-ip-sync-hidden.vbs +5 -0
- package/scripts/qq-ip-sync.py +300 -0
- package/scripts/qq-login-once.cmd +20 -0
- package/scripts/qq-login-qr.py +72 -0
- package/scripts/qq-whitelist-fix.cmd +27 -0
- package/scripts/qq-whitelist-login.cmd +26 -0
- package/scripts/qq-whitelist.cmd +12 -0
- package/scripts/qq-whitelist.py +1452 -0
- package/scripts/quality-compare.py +134 -0
- package/scripts/release-all.mjs +636 -430
- package/scripts/release-check.mjs +244 -226
- package/scripts/resume-coder.cmd +38 -0
- package/scripts/secure-room/index.html +334 -0
- package/scripts/secure-room/server.py +582 -0
- package/scripts/security-check.mjs +164 -0
- package/scripts/selftest-local-llm.mjs +20 -0
- package/scripts/selftest-local-models.mjs +754 -0
- package/scripts/selftest-rotate-style.mjs +308 -0
- package/scripts/shutdown-s5-optional.cmd +21 -0
- package/scripts/sleep-2325.cmd +75 -0
- package/scripts/start-comfyui.cmd +5 -0
- package/scripts/start-strata.cmd +17 -0
- package/scripts/start-strata.vbs +11 -0
- package/scripts/start-watch-hidden.vbs +3 -0
- package/scripts/stickers/auto-tag.mjs +161 -0
- package/scripts/storage.mjs +236 -0
- package/scripts/sync-plugin-copies.mjs +98 -23
- package/scripts/tests/test-qq-whitelist.py +192 -0
- package/scripts/train/__pycache__/train-lora.cpython-311.pyc +0 -0
- package/scripts/train/gguf-quantize.py +92 -0
- package/scripts/train/gguf-to-hf.py +112 -0
- package/scripts/train/merge-lora.py +51 -0
- package/scripts/train/probe-mirrors.sh +12 -0
- package/scripts/train/probe-mirrors2.sh +20 -0
- package/scripts/train/setup-wsl.sh +23 -0
- package/scripts/train/setup-wsl2.sh +25 -0
- package/scripts/train/setup-wsl3.sh +22 -0
- package/scripts/train/setup-wsl4.sh +22 -0
- package/scripts/train/train-lora.py +319 -0
- package/scripts/vram-free.py +104 -0
- package/scripts/wechat-full-pull.mjs +1 -1
- package/settings-host.js +1047 -12
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""compose-video.py — 本地成片合成(ffmpeg,零云 token、零 DSH 依赖)。
|
|
3
|
+
|
|
4
|
+
定位:HyperFrames/Remotion 那套是 agent 侧的可视化模板渲染,装在 DSH 里,
|
|
5
|
+
QQBot 想用就要绕一圈。这个脚本把「剪辑/合成」这件最常用的事做成本地命令行:
|
|
6
|
+
把素材(片段/图片)按文件名顺序拼成一条片,统一分辨率/帧率,可选 BGM 和淡入淡出。
|
|
7
|
+
|
|
8
|
+
素材顺序 = 文件名排序,所以命名用 01_xxx.mp4 / 02_xxx.png 这样最省事。
|
|
9
|
+
|
|
10
|
+
用法:
|
|
11
|
+
python scripts/compose-video.py -i F:\\qqbot\\data\\out --out F:\\qqbot\\data\\out\\final.mp4
|
|
12
|
+
python scripts/compose-video.py -i clips -o final.mp4 --bgm F:\\qqbot\\assets\\bgm.wav --fade 0.4
|
|
13
|
+
python scripts/compose-video.py -i clips -o final.mp4 --w 1080 --h 1920 --fps 30 # 竖屏
|
|
14
|
+
python scripts/compose-video.py -i clips -o final.mp4 --img-sec 2.5 # 图片停留秒数
|
|
15
|
+
|
|
16
|
+
谁在调:
|
|
17
|
+
- 桌面「本地成片合成」
|
|
18
|
+
- ComfyUI 出完图/出完视频后,把 data\\out 下的东西拼成片
|
|
19
|
+
"""
|
|
20
|
+
import argparse
|
|
21
|
+
import os
|
|
22
|
+
import shutil
|
|
23
|
+
import subprocess
|
|
24
|
+
import sys
|
|
25
|
+
import tempfile
|
|
26
|
+
|
|
27
|
+
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
28
|
+
FFMPEG = os.environ.get("FFMPEG") or os.path.join(ROOT, "bin", "ffmpeg", "ffmpeg.exe")
|
|
29
|
+
VIDEO_EXT = (".mp4", ".mov", ".mkv", ".webm", ".avi", ".m4v")
|
|
30
|
+
IMAGE_EXT = (".png", ".jpg", ".jpeg", ".webp", ".bmp")
|
|
31
|
+
CNW = 0x08000000
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def log(m):
|
|
35
|
+
print("[compose] " + str(m), flush=True)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def run(args, timeout=1800):
|
|
39
|
+
p = subprocess.run(args, capture_output=True, text=True, timeout=timeout, creationflags=CNW)
|
|
40
|
+
if p.returncode != 0:
|
|
41
|
+
raise RuntimeError("ffmpeg 失败(%d): %s" % (p.returncode, (p.stderr or "")[-1200:]))
|
|
42
|
+
return p
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def collect(src):
|
|
46
|
+
files = []
|
|
47
|
+
if os.path.isfile(src):
|
|
48
|
+
return [src]
|
|
49
|
+
for name in sorted(os.listdir(src)):
|
|
50
|
+
low = name.lower()
|
|
51
|
+
if low.endswith(VIDEO_EXT + IMAGE_EXT):
|
|
52
|
+
files.append(os.path.join(src, name))
|
|
53
|
+
return files
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def img_to_clip(img, out, w, h, fps, sec):
|
|
57
|
+
"""图片 → 定长片段(等比缩放 + 黑边补齐,避免拉伸变形)。"""
|
|
58
|
+
vf = ("scale=%d:%d:force_original_aspect_ratio=decrease,"
|
|
59
|
+
"pad=%d:%d:(ow-iw)/2:(oh-ih)/2:color=black,format=yuv420p" % (w, h, w, h))
|
|
60
|
+
run([FFMPEG, "-y", "-loop", "1", "-t", str(sec), "-i", img,
|
|
61
|
+
"-r", str(fps), "-vf", vf, "-c:v", "libx264", "-preset", "veryfast", "-crf", "20",
|
|
62
|
+
"-an", out], 600)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def norm_clip(src, out, w, h, fps):
|
|
66
|
+
"""片段 → 统一分辨率/帧率/像素格式(合成本身不改内容)。"""
|
|
67
|
+
vf = ("scale=%d:%d:force_original_aspect_ratio=decrease,"
|
|
68
|
+
"pad=%d:%d:(ow-iw)/2:(oh-ih)/2:color=black,fps=%d,format=yuv420p" % (w, h, w, h, fps))
|
|
69
|
+
run([FFMPEG, "-y", "-i", src, "-vf", vf, "-c:v", "libx264", "-preset", "veryfast", "-crf", "20",
|
|
70
|
+
"-c:a", "aac", "-ar", "44100", "-ac", "2", "-af", "aresample=async=1:first_pts=0", out], 1800)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def has_audio(path):
|
|
74
|
+
p = subprocess.run([FFMPEG.replace("ffmpeg.exe", "ffprobe.exe"), "-v", "error", "-select_streams", "a",
|
|
75
|
+
"-show_entries", "stream=index", "-of", "csv=p=0", path],
|
|
76
|
+
capture_output=True, text=True, creationflags=CNW)
|
|
77
|
+
return bool((p.stdout or "").strip())
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def main():
|
|
81
|
+
ap = argparse.ArgumentParser()
|
|
82
|
+
ap.add_argument("-i", "--input", required=True, help="素材目录或单个文件")
|
|
83
|
+
ap.add_argument("-o", "--out", default="", help="输出 mp4")
|
|
84
|
+
ap.add_argument("--w", type=int, default=1280)
|
|
85
|
+
ap.add_argument("--h", type=int, default=720)
|
|
86
|
+
ap.add_argument("--fps", type=int, default=30)
|
|
87
|
+
ap.add_argument("--img-sec", type=float, default=3.0, help="每张图片停留秒数")
|
|
88
|
+
ap.add_argument("--bgm", default="", help="背景音乐文件(可选)")
|
|
89
|
+
ap.add_argument("--music-volume", type=float, default=0.25)
|
|
90
|
+
ap.add_argument("--fade", type=float, default=0.0, help="整片头尾淡入淡出秒数(0=关)")
|
|
91
|
+
ap.add_argument("--keep-temp", action="store_true")
|
|
92
|
+
a = ap.parse_args()
|
|
93
|
+
|
|
94
|
+
if not os.path.exists(FFMPEG):
|
|
95
|
+
log("找不到 ffmpeg: %s" % FFMPEG)
|
|
96
|
+
return 3
|
|
97
|
+
files = collect(a.input)
|
|
98
|
+
if not files:
|
|
99
|
+
log("素材目录里没有视频/图片: %s" % a.input)
|
|
100
|
+
return 2
|
|
101
|
+
out = a.out or os.path.join(os.path.dirname(os.path.abspath(files[0])), "final.mp4")
|
|
102
|
+
if a.w % 2 or a.h % 2:
|
|
103
|
+
log("宽高必须是偶数(h264 要求)")
|
|
104
|
+
return 2
|
|
105
|
+
|
|
106
|
+
# 临时目录放在仓库里:系统 %TEMP% 在受限环境(沙箱/服务账号)常常不可写
|
|
107
|
+
tmp_root = os.path.join(ROOT, "tmp")
|
|
108
|
+
try:
|
|
109
|
+
os.makedirs(tmp_root, exist_ok=True)
|
|
110
|
+
tmp = tempfile.mkdtemp(prefix="compose-", dir=tmp_root)
|
|
111
|
+
except Exception:
|
|
112
|
+
tmp = tempfile.mkdtemp(prefix="compose-")
|
|
113
|
+
try:
|
|
114
|
+
parts = []
|
|
115
|
+
for i, f in enumerate(files, 1):
|
|
116
|
+
dst = os.path.join(tmp, "p%03d.mp4" % i)
|
|
117
|
+
log("%d/%d %s" % (i, len(files), os.path.basename(f)))
|
|
118
|
+
if f.lower().endswith(IMAGE_EXT):
|
|
119
|
+
img_to_clip(f, dst, a.w, a.h, a.fps, a.img_sec)
|
|
120
|
+
else:
|
|
121
|
+
norm_clip(f, dst, a.w, a.h, a.fps)
|
|
122
|
+
parts.append(dst)
|
|
123
|
+
|
|
124
|
+
lst = os.path.join(tmp, "list.txt")
|
|
125
|
+
with open(lst, "w", encoding="utf-8") as fh:
|
|
126
|
+
for p in parts:
|
|
127
|
+
fh.write("file '%s'\n" % p.replace("\\", "/"))
|
|
128
|
+
|
|
129
|
+
merged = os.path.join(tmp, "merged.mp4")
|
|
130
|
+
run([FFMPEG, "-y", "-f", "concat", "-safe", "0", "-i", lst, "-c", "copy", merged], 1800)
|
|
131
|
+
|
|
132
|
+
final = merged
|
|
133
|
+
if a.bgm and os.path.exists(a.bgm):
|
|
134
|
+
withbgm = os.path.join(tmp, "withbgm.mp4")
|
|
135
|
+
run([FFMPEG, "-y", "-i", merged, "-stream_loop", "-1", "-i", a.bgm,
|
|
136
|
+
"-filter_complex", "[1:a]volume=%s[m];[0:a][m]amix=inputs=2:duration=first:dropout_transition=0[a]"
|
|
137
|
+
% a.music_volume,
|
|
138
|
+
"-map", "0:v", "-map", "[a]", "-c:v", "copy", "-c:a", "aac", "-shortest", withbgm], 1800)
|
|
139
|
+
final = withbgm
|
|
140
|
+
elif not has_audio(merged) and a.bgm:
|
|
141
|
+
log("BGM 文件不存在,跳过: %s" % a.bgm)
|
|
142
|
+
|
|
143
|
+
if a.fade and a.fade > 0:
|
|
144
|
+
faded = os.path.join(tmp, "faded.mp4")
|
|
145
|
+
dur = float(subprocess.run([FFMPEG.replace("ffmpeg.exe", "ffprobe.exe"), "-v", "error",
|
|
146
|
+
"-show_entries", "format=duration", "-of", "csv=p=0", final],
|
|
147
|
+
capture_output=True, text=True, creationflags=CNW).stdout.strip() or 0)
|
|
148
|
+
if dur > a.fade * 2:
|
|
149
|
+
run([FFMPEG, "-y", "-i", final, "-vf",
|
|
150
|
+
"fade=t=in:st=0:d=%s,fade=t=out:st=%s:d=%s" % (a.fade, dur - a.fade, a.fade),
|
|
151
|
+
"-c:a", "copy", faded], 1800)
|
|
152
|
+
final = faded
|
|
153
|
+
|
|
154
|
+
os.makedirs(os.path.dirname(os.path.abspath(out)), exist_ok=True)
|
|
155
|
+
shutil.copyfile(final, out)
|
|
156
|
+
size = os.path.getsize(out) / 1048576.0
|
|
157
|
+
log("done -> %s (%.1f MB)" % (out, size))
|
|
158
|
+
return 0
|
|
159
|
+
except Exception as e:
|
|
160
|
+
log("失败: %s" % e)
|
|
161
|
+
return 5
|
|
162
|
+
finally:
|
|
163
|
+
if not a.keep_temp:
|
|
164
|
+
shutil.rmtree(tmp, ignore_errors=True)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
if __name__ == "__main__":
|
|
168
|
+
sys.exit(main())
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Download image/video model weights from ModelScope to F: drive.
|
|
2
|
+
|
|
3
|
+
Usage: python dl_models.py {video|image|small}
|
|
4
|
+
"""
|
|
5
|
+
import sys, time
|
|
6
|
+
from modelscope import snapshot_download
|
|
7
|
+
|
|
8
|
+
JOBS = {
|
|
9
|
+
"video": [
|
|
10
|
+
("Comfy-Org/Wan_2.2_ComfyUI_Repackaged",
|
|
11
|
+
["split_files/diffusion_models/wan2.2_ti2v_5B_fp16.safetensors",
|
|
12
|
+
"split_files/text_encoders/umt5_xxl_fp16.safetensors"],
|
|
13
|
+
r"F:\qqbot\.models\wan22-ti2v-5b"),
|
|
14
|
+
],
|
|
15
|
+
"image": [
|
|
16
|
+
("city96/FLUX.1-schnell-gguf",
|
|
17
|
+
["flux1-schnell-Q6_K.gguf"],
|
|
18
|
+
r"F:\qqbot\.models\flux-schnell-gguf"),
|
|
19
|
+
("city96/t5-v1_1-xxl-encoder-gguf",
|
|
20
|
+
["t5-v1_1-xxl-encoder-Q5_K_M.gguf"],
|
|
21
|
+
r"F:\qqbot\.models\flux-schnell-gguf"),
|
|
22
|
+
("black-forest-labs/FLUX.1-schnell",
|
|
23
|
+
["ae.safetensors", "text_encoder/model.safetensors"],
|
|
24
|
+
r"F:\qqbot\.models\flux-schnell-gguf"),
|
|
25
|
+
],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def main():
|
|
30
|
+
which = sys.argv[1]
|
|
31
|
+
for model, patterns, local_dir in JOBS[which]:
|
|
32
|
+
t0 = time.time()
|
|
33
|
+
print("[%s] start %s -> %s" % (time.strftime("%H:%M:%S"), model, local_dir), flush=True)
|
|
34
|
+
try:
|
|
35
|
+
p = snapshot_download(model, allow_patterns=patterns, local_dir=local_dir,
|
|
36
|
+
max_workers=3)
|
|
37
|
+
print("[%s] done %s in %.0fs -> %s" % (time.strftime("%H:%M:%S"), model, time.time() - t0, p), flush=True)
|
|
38
|
+
except Exception as e:
|
|
39
|
+
print("[%s] FAIL %s: %r" % (time.strftime("%H:%M:%S"), model, e), flush=True)
|
|
40
|
+
raise
|
|
41
|
+
print("ALL DONE", flush=True)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
main()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM draw-now.cmd - double-click friendly FLUX text-to-image (ComfyUI 8191).
|
|
3
|
+
REM Type a prompt, get a PNG in F:\qqbot\data\out and it opens the folder.
|
|
4
|
+
chcp 936 >nul
|
|
5
|
+
setlocal
|
|
6
|
+
set "PY=E:\Anaconda\envs\ai25\python.exe"
|
|
7
|
+
echo ================================================
|
|
8
|
+
echo Local text-to-image (FLUX.1-schnell / ComfyUI)
|
|
9
|
+
echo write a prompt, Enter. Empty = a demo prompt.
|
|
10
|
+
echo ================================================
|
|
11
|
+
set "P="
|
|
12
|
+
set /p "P=prompt: "
|
|
13
|
+
if "%P%"=="" set "P=a red panda barista in a cozy cafe, cinematic light"
|
|
14
|
+
"%PY%" F:\qqbot\scripts\gen-image.py --start -p "%P%" --w 1024 --h 1024 --steps 4
|
|
15
|
+
echo.
|
|
16
|
+
echo done. output folder: F:\qqbot\data\out
|
|
17
|
+
start "" explorer.exe "F:\qqbot\data\out"
|
|
18
|
+
pause
|
|
@@ -17,10 +17,28 @@ import { createServer } from 'node:net'
|
|
|
17
17
|
import { execFileSync } from 'node:child_process'
|
|
18
18
|
import { randomUUID } from 'node:crypto'
|
|
19
19
|
import { dirname, join } from 'node:path'
|
|
20
|
-
import { pathToFileURL } from 'node:url'
|
|
20
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
21
|
+
|
|
22
|
+
/** 2026-12-01:这个文件以前直接调 __repoRoot(),但那是 bootstrap 里的局部函数 —— 独立脚本里没有,
|
|
23
|
+
* 于是启动日志一直刷「单实例守护失败:__repoRoot is not defined」,旧进程没人清(会双回复)。
|
|
24
|
+
* 这里自己解析:环境变量 > 安装副本里的 repo-root 指针 > 脚本所在仓库根。 */
|
|
25
|
+
function resolveRepoRoot() {
|
|
26
|
+
const envRoot = String(process.env.QQBOT_REPO_ROOT || process.env.QQBOT_ROOT || '').trim()
|
|
27
|
+
if (envRoot) return envRoot.replace(/\\/g, '/').replace(/\/+$/, '')
|
|
28
|
+
let root = ''
|
|
29
|
+
try { root = dirname(dirname(fileURLToPath(import.meta.url))) } catch { root = process.cwd() }
|
|
30
|
+
try {
|
|
31
|
+
const j = JSON.parse(readFileSync(join(root, 'config', 'repo-root.json'), 'utf8'))
|
|
32
|
+
if (j && j.root) return String(j.root).replace(/\\/g, '/').replace(/\/+$/, '')
|
|
33
|
+
} catch { /* 没有指针就用脚本位置 */ }
|
|
34
|
+
return String(root || process.cwd()).replace(/\\/g, '/').replace(/\/+$/, '')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DATA_ROOT = String(process.env.QQBOT_MEMORY_DATA_ROOT || '').trim()
|
|
38
|
+
|| (resolveRepoRoot() + '/dshqqbot')
|
|
21
39
|
|
|
22
40
|
export const LOCK_PORT = Number(process.env.DSH_GUARD_PORT || 4789)
|
|
23
|
-
export const LOCK_FILE = process.env.DSH_GUARD_LOCK ||
|
|
41
|
+
export const LOCK_FILE = process.env.DSH_GUARD_LOCK || DATA_ROOT + '/.qqbot/dsh-instance.json'
|
|
24
42
|
|
|
25
43
|
const isWin = process.platform === 'win32'
|
|
26
44
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal EnableExtensions
|
|
3
|
+
chcp 936 >nul
|
|
4
|
+
|
|
5
|
+
REM ############################################################################
|
|
6
|
+
REM # elev-extra.cmd ���� ������Ȩ����һ�� UAC��
|
|
7
|
+
REM #
|
|
8
|
+
REM # ������£�
|
|
9
|
+
REM # 1) ���ȣ�apply-fan-gpu45.py 45���Կ��ֶ�ת�ٹ̶� 45%��
|
|
10
|
+
REM # 2) ���µ��� powercfg /a �� /waketimers ����
|
|
11
|
+
REM # 3) ��ӡ������������״̬
|
|
12
|
+
REM #
|
|
13
|
+
REM # ��־��F:\qqbot\logs\elev-extra.log
|
|
14
|
+
REM # �ɹ���־�����һ�� ELEV_EXTRA_DONE rc=0
|
|
15
|
+
REM ############################################################################
|
|
16
|
+
|
|
17
|
+
echo.
|
|
18
|
+
echo �������� UAC ��Ȩ�����ڵ���㡸�ǡ���
|
|
19
|
+
echo ��־��F:\qqbot\logs\elev-extra.log
|
|
20
|
+
echo.
|
|
21
|
+
|
|
22
|
+
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -Verb RunAs -FilePath powershell -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','F:\qqbot\scripts\elev-extra.ps1' -WindowStyle Hidden"
|
|
23
|
+
|
|
24
|
+
endlocal
|
|
25
|
+
exit /b 0
|