Rename caption GGUF NSFW labels to NS.
Point caption host scripts at the renamed local Comfy models folder and filenames; no Comfy workflow JSONs referenced those files. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,13 +6,13 @@ import { pipeline } from 'node:stream/promises'
|
||||
import { Transform } from 'node:stream'
|
||||
import { captionStylePrompt, CAPTION_STYLES } from '../shared/caption.mjs'
|
||||
|
||||
const MODEL_NAME = 'Qwen2.5-VL-7B-NSFW-Caption-V4.Q5_K_M.gguf'
|
||||
const MMPROJ_NAME = 'Qwen2.5-VL-7B-NSFW-Caption-V4.mmproj-f16.gguf'
|
||||
const MODEL_NAME = 'Qwen2.5-VL-7B-NS-Caption-V4.Q5_K_M.gguf'
|
||||
const MMPROJ_NAME = 'Qwen2.5-VL-7B-NS-Caption-V4.mmproj-f16.gguf'
|
||||
|
||||
function defaultModelsDir() {
|
||||
const shared = process.env.COMFY_MODELS_ROOT
|
||||
|| join(process.env.LOCALAPPDATA || '', 'Comfy-Desktop', 'ComfyUI-Shared', 'models')
|
||||
return resolve(process.env.CAPTION_MODELS || join(shared, 'caption', 'qwen25vl-7b-nsfw-v4'))
|
||||
return resolve(process.env.CAPTION_MODELS || join(shared, 'caption', 'qwen25vl-7b-ns-v4'))
|
||||
}
|
||||
|
||||
/** Prefer winget ggml.llamacpp; never download. Process exit after one caption = keep_alive 0. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Caption (Qwen2.5-VL NSFW Caption V4 GGUF) — verify host files only.
|
||||
# Caption (Qwen2.5-VL NS Caption V4 GGUF) — verify host files only.
|
||||
# Models are already on the 5080 host. Do not download. Do not search Hugging Face.
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -10,14 +10,14 @@ function Resolve-ModelsRoot {
|
||||
throw 'Set COMFY_MODELS_ROOT or install Comfy Desktop Shared models.'
|
||||
}
|
||||
|
||||
$root = Join-Path (Resolve-ModelsRoot) 'caption\qwen25vl-7b-nsfw-v4'
|
||||
$root = Join-Path (Resolve-ModelsRoot) 'caption\qwen25vl-7b-ns-v4'
|
||||
if (-not (Test-Path $root)) {
|
||||
throw "Caption models folder missing: $root"
|
||||
}
|
||||
|
||||
$files = @(
|
||||
'Qwen2.5-VL-7B-NSFW-Caption-V4.Q5_K_M.gguf',
|
||||
'Qwen2.5-VL-7B-NSFW-Caption-V4.mmproj-f16.gguf'
|
||||
'Qwen2.5-VL-7B-NS-Caption-V4.Q5_K_M.gguf',
|
||||
'Qwen2.5-VL-7B-NS-Caption-V4.mmproj-f16.gguf'
|
||||
)
|
||||
|
||||
foreach ($name in $files) {
|
||||
@@ -44,8 +44,8 @@ $llamaPath = if ($llama.PSObject.Properties['FullName'] -and $llama.FullName) {
|
||||
Write-Host "llama-server: $llamaPath"
|
||||
|
||||
$ready = @{
|
||||
model = 'Qwen2.5-VL-7B-NSFW-Caption-V4.Q5_K_M.gguf'
|
||||
mmproj = 'Qwen2.5-VL-7B-NSFW-Caption-V4.mmproj-f16.gguf'
|
||||
model = 'Qwen2.5-VL-7B-NS-Caption-V4.Q5_K_M.gguf'
|
||||
mmproj = 'Qwen2.5-VL-7B-NS-Caption-V4.mmproj-f16.gguf'
|
||||
modelsDir = $root
|
||||
llamaServer = $llamaPath
|
||||
readyAt = (Get-Date).ToUniversalTime().ToString('o')
|
||||
|
||||
@@ -19,7 +19,7 @@ Get-NetTCPConnection -LocalPort 8199 -State Listen -ErrorAction SilentlyContinue
|
||||
Start-Sleep -Milliseconds 400
|
||||
|
||||
# Caption VLM — point at existing host GGUFs (no download).
|
||||
$captionModels = Join-Path $env:LOCALAPPDATA 'Comfy-Desktop\ComfyUI-Shared\models\caption\qwen25vl-7b-nsfw-v4'
|
||||
$captionModels = Join-Path $env:LOCALAPPDATA 'Comfy-Desktop\ComfyUI-Shared\models\caption\qwen25vl-7b-ns-v4'
|
||||
$llamaServer = Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages\ggml.llamacpp_Microsoft.Winget.Source_8wekyb3d8bbwe\llama-server.exe'
|
||||
if (Test-Path $captionModels) { $env:CAPTION_MODELS = $captionModels }
|
||||
if (Test-Path $llamaServer) { $env:CAPTION_LLAMA_SERVER = $llamaServer }
|
||||
|
||||
@@ -15,8 +15,8 @@ assert.throws(() => validateCaptionHostRequest({ id: 'short', style: 'descriptiv
|
||||
const root = mkdtempSync(join(tmpdir(), 'caption-test-'))
|
||||
const models = join(root, 'models')
|
||||
mkdirSync(models)
|
||||
writeFileSync(join(models, 'Qwen2.5-VL-7B-NSFW-Caption-V4.Q5_K_M.gguf'), 'x')
|
||||
writeFileSync(join(models, 'Qwen2.5-VL-7B-NSFW-Caption-V4.mmproj-f16.gguf'), 'x')
|
||||
writeFileSync(join(models, 'Qwen2.5-VL-7B-NS-Caption-V4.Q5_K_M.gguf'), 'x')
|
||||
writeFileSync(join(models, 'Qwen2.5-VL-7B-NS-Caption-V4.mmproj-f16.gguf'), 'x')
|
||||
writeFileSync(join(root, 'llama-server.exe'), 'x')
|
||||
|
||||
let prepared = 0
|
||||
|
||||
Reference in New Issue
Block a user