53 Commits
Author SHA1 Message Date
Suzu008 ea890f4837 fix: defer upload video preview until configure restores saved values
Remove premature preview load in onNodeCreated (videoWidget.value not yet restored from workflow state). Instead override configure() to update preview after values are restored, ensuring the correct video is displayed on page reload.
2026-05-31 20:55:00 +08:00
Suzu008 919dcffaf2 fix: reuse video preview widgets to support Vue Nodes 2.0 mode
- SaveVideo/PreviewVideo: reuse existing video-preview widgets instead of removing and recreating them on each execution, preventing WidgetDOM from losing its mounted element reference in VueNodes mode

- UploadVideo: remove duplicate updateVideoWidget call in handleVideoUpload that caused parallel fetch/decrypt race on the same widget element
2026-05-31 18:02:55 +08:00
Suzu008 bc931fb343 update TODO 2026-05-31 01:32:29 +08:00
Suzu008 2aa1aee12a fix: trigger widget callback on upload to enable Vue Nodes 2.0 preview 2026-05-31 01:32:18 +08:00
Suzu008 a58a5b8917 refactor(sw): bidirectional SW status sync with IndexedDB persistence
Replace fire-and-forget key delivery with a sync-status protocol that
verifies key consistency between main thread and Service Worker using
SHA-256 fingerprints via MessageChannel request-response.

- SW (ts/sw.ts): persist keys in IndexedDB, auto-restore on activate;
  respond to sync-status queries with loaded keys + fingerprints;
  support cryptio-clear-keys to wipe memory + DB.
- New ts/utils/swSync.ts: single entry point for SW registration,
  key sync, and status verification. Controller change listener
  re-syncs on SW restart. Deduplicates concurrent sync calls.
- Deleted ts/utils/swKeySender.ts (replaced by swSync.ts).
- Remove SW registration (~55 lines) from cryptioSaveImage.ts;
  setup() now calls syncSWStatus().
- uploadUtils.ts: drop 5-retry preview loop (~6.4s worst case);
  single attempt with syncSWStatus fallback on failure.
- cryptioSettings.ts: sync after key changes; clearSWKeys() on
  Clear All.
- cryptioUploadImage/Video.ts: syncSWStatus in setup + preview
  fallback.
- types.ts: add SWStatus interface.
2026-05-30 22:29:45 +08:00
Suzu008 cf62be54eb refactor(settings): replace boolean toggles with custom renderer UI
- Use ComfyUI SettingCustomRenderer API for action buttons instead of ToggleSwitch
- Add key status display (Client/Server key configuration state)
- Replace raw DOM toast with app.extensionManager.toast API
- Replace window.confirm with app.extensionManager.dialog API
- Inject themed CSS matching ComfyUI design tokens
- Add pi-icon buttons with primary/default/danger variants
- Change category to [CryptIO🔒, Key Management] for proper nav tree structure
2026-05-28 17:05:51 +08:00
Suzu008 28abb6388d fix: filter encrypted uploads by supported media types 2026-05-28 15:10:39 +08:00
Suzu008 ca0e42e767 fix: replace non-standard removeWidgetByName with manual removal logic 2026-03-24 22:01:45 +08:00
Suzu008 8a335dbaee refactor: improve type safety with custom interfaces (Fix 11) 2026-03-24 20:59:40 +08:00
Suzu008 4e0bfdd82e refactor: extract duplicated code into shared modules (videoWidgetUtils, uploadUtils, fileUtils) 2026-03-24 08:53:08 +08:00
Suzu008 17c8ede5e9 perf: parallelize video decryption using Promise.allSettled 2026-03-24 08:44:39 +08:00
Suzu008 ab1746b5e8 fix: prevent blob URL memory leaks by tracking and revoking URLs on re-execution and node removal 2026-03-24 08:43:17 +08:00
Suzu008 f905c7bc47 fix: use chunked base64 conversion to prevent stack overflow on large files 2026-03-24 08:37:42 +08:00
Suzu008 2a8c29d5c0 perf: deduplicate concurrent exchangeKeys() calls with in-flight promise guard 2026-03-24 08:34:57 +08:00
Suzu008 0a29b74d66 refactor: replace new Uint8Array() re-wrap with 'as BlobPart' type assertion 2026-03-24 08:33:08 +08:00
Suzu008 6b21112d59 refactor: use replaceChildren() instead of while-loop DOM cleanup 2026-03-24 08:31:20 +08:00
Suzu008 1dfc6c6f82 fix: prevent file input DOM leak in cryptioSettings.ts createFileInput 2026-03-24 08:30:21 +08:00
Suzu008 3e662b248a refactor: remove unused createVideoPreviewElement from videoLoader.ts 2026-03-24 08:29:20 +08:00
Suzu008 0c9d2e21e7 refactor: remove dead getPublicKey() and PUBLIC_KEY_STORAGE_KEY from textEncrypt.ts 2026-03-24 08:28:27 +08:00
Suzu008 2253dc4920 Merge branch 'main' into dev 2025-12-16 23:15:32 +08:00
Suzu008 e1bceae2ca setup 2025-12-16 23:10:42 +08:00
Suzu008 a90d6ac461 refactor: 更新密钥保存位置 2025-12-10 04:06:19 +08:00
Suzu008 958f78164f feat: 为图片节点添加图片格式和保存质量组件 2025-12-10 04:05:46 +08:00
Suzu008 a943462bbd refactor(cryptio): 优化视频保存逻辑,统一处理重封装和重新编码 2025-12-10 02:40:21 +08:00
Suzu008 5a59b11db7 fix: change input field name for text encryption node 2025-11-26 18:33:43 +08:00
Suzu008 68edf1af62 refactor: clean up code structure and improve category labels in CryptIO components 2025-11-26 18:23:05 +08:00
Suzu008 83a3876d09 feat(cryptio): add settings integration for key management in ComfyUI 2025-11-26 17:53:05 +08:00
Suzu008 1e5ff339d3 chore:update 2025-11-26 15:48:05 +08:00
Suzu008 ec92bf6b4a refactor(api): 改进加密文件名生成逻辑
使用更安全的随机字符串生成方法,并保留原始文件名特征
确保生成的文件名唯一且避免冲突
2025-10-13 05:30:22 +08:00
Suzu008 c454a7d015 refactor(cryptio): 使用内存缓冲区替代临时文件保存视频
移除临时文件操作,改为使用BytesIO内存缓冲区处理视频数据,避免明文写入磁盘
同时将工作流元数据直接嵌入视频文件,不再单独保存JSON文件
2025-10-13 05:07:44 +08:00
Suzu008 b5a62ef000 feat(视频处理): 添加视频加密上传、保存和预览功能
- 实现视频文件的上传、加密保存和解密预览功能
- 新增视频加载器模块处理视频解密和预览
- 扩展文件工具类支持更多视频格式
- 添加前端组件处理视频上传和预览交互
2025-10-13 04:46:45 +08:00
Suzu008 9d4953d427 refactor(cryptio): 重构文本加密解密节点并添加前端实现
将ClientEncrypt和ServerDecrypt合并为TextEncrypt和TextDecrypt节点
添加前端TypeScript实现处理加密解密逻辑
更新节点显示名称并添加加密图标标识
修复Python导入警告并添加类型忽略注释
2025-10-12 15:00:48 +08:00
Suzu008 2ebf987648 refactor(cryptio): 重构密钥管理模块并优化加密功能
将密钥管理逻辑从 keys.py 迁移到 utils 模块,实现 KeyManager 单例类
新增 crypto_utils 模块集中管理加密/解密功能
优化混合加密方案实现,提高代码复用性和可维护性
2025-10-12 13:30:29 +08:00
Suzu008 b809568a75 refactor(crypto): 优化加密功能并添加base64工具
- 重命名加密函数以更准确反映用途
- 提取base64转换逻辑到独立工具文件
- 简化文本加密流程,移除冗余代码
2025-10-12 12:26:43 +08:00
Suzu008 6ed9ea5b1f refactor(crypto): 重构加密模块以支持不同密钥场景
- 将通用加密解密逻辑提取为内部函数
- 添加针对不同场景的加密解密方法(服务端/客户端密钥)
- 更新相关调用代码以使用新的加密方法
- 改进注释和类型定义
2025-10-12 07:04:20 +08:00
Suzu008 05ac7e0542 refactor(utils): 重构加密文件处理工具模块
将加密文件处理相关功能拆分为独立工具模块,包括文件工具、上传工具、图片加载工具和加密工具

重构 cryptioSaveImage.ts 和 cryptioUploadImage.ts,使用新的工具模块替换原有代码
2025-10-12 06:34:57 +08:00
Suzu008 790907bdf6 feat(cryptio): 添加自动下载解密图片功能
为SaveImageCryptIO和PreviewImageCryptIO类添加auto_download参数,当设置为true时自动下载解密后的图片。同时在TS端实现自动下载逻辑,通过创建临时链接触发浏览器下载行为。
2025-10-12 06:21:15 +08:00
Suzu008 5f1f993559 feat(cryptio): 添加加密图片保存和预览功能
实现加密图片保存(SaveImageCryptIO)和预览(PreviewImageCryptIO)节点
修改上传组件支持加密文件直接上传
添加前端解密逻辑用于预览加密图片
2025-10-12 05:56:36 +08:00
Suzu008 b065ca33b6 feat(上传): 添加拖放和粘贴支持并重构上传逻辑
- 将上传逻辑提取为通用方法handleFileUpload
- 为上传组件添加拖放和粘贴支持
- 更新上传参数从image_upload改为file_upload
2025-10-12 03:57:16 +08:00
Suzu008 3faf0a1f0a set mime 2025-10-12 03:31:12 +08:00
Suzu008 d449590ac3 fix: remove not exist arg 2025-10-12 01:29:37 +08:00
Suzu008 b2ef9c8f7a fix: get gcm key 2025-10-12 01:29:05 +08:00
Suzu008 355cd52d8c remote redundant code, remove original upload widget 2025-10-12 01:14:59 +08:00
Suzu008 e5d09afc01 view_encrypted respond with binary 2025-10-11 21:01:39 +08:00
Suzu008 2ef5042d3d rename severkey pair in client side 2025-10-11 20:46:38 +08:00
Suzu008 e221d61dce remove mannually padding remoove process( which is already done in decrypt process 2025-10-11 20:16:36 +08:00
Suzu008 a5ba357ed7 upload Image cryptio and key exchange 2025-10-11 18:46:44 +08:00
Suzu008 268d5559b4 uploadImage cryptIO temp 2025-10-11 18:33:16 +08:00
Suzu008 b8629abb49 rename 2025-10-11 10:39:35 +08:00
Suzu008 72eeea8dfa sepate files 2025-10-11 10:30:47 +08:00