koishi-plugin-p-draw 1.5.7 → 1.5.8
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/index.js +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -174,8 +174,7 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
174
174
|
// 用户自选模型偏好(userid -> unet 文件名),持久化在 p_draw_config.user_models
|
|
175
175
|
if (!cfg.userModels || typeof cfg.userModels !== 'object') cfg.userModels = {}
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
// 启动时清理上次运行遗留的临时文件
|
|
177
|
+
// 启动时清理上次运行遗留的临时目录(先清理,再创建本次目录)
|
|
179
178
|
try {
|
|
180
179
|
const leftovers = fs.readdirSync(os.tmpdir()).filter((n) => n.startsWith('pdraw-'))
|
|
181
180
|
for (const name of leftovers) {
|
|
@@ -187,6 +186,8 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
187
186
|
}
|
|
188
187
|
} catch (e) { /* ignore */ }
|
|
189
188
|
|
|
189
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pdraw-'))
|
|
190
|
+
|
|
190
191
|
const baseUrl = () => normalizeBaseUrl(cfg.comfyuiBaseUrl)
|
|
191
192
|
|
|
192
193
|
function parseAllowedSizes() {
|