This commit is contained in:
mike
2026-06-20 04:44:35 +02:00
parent f49af6b33a
commit cfb2e45f1f
21 changed files with 4579 additions and 273 deletions

151
.trash/architecture.svg Normal file
View File

@@ -0,0 +1,151 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800">
<style>
.component {
fill: #e3f2fd;
stroke: #1976d2;
stroke-width: 2;
rx: 10;
ry: 10;
}
.label {
font-family: Arial, sans-serif;
font-size: 14px;
font-weight: bold;
text-anchor: middle;
}
.sublabel {
font-family: Arial, sans-serif;
font-size: 12px;
text-anchor: middle;
}
.connection {
stroke: #757575;
stroke-width: 2;
marker-end: url(#arrowhead);
}
.database {
fill: #ffebee;
stroke: #d32f2f;
stroke-width: 2;
rx: 10;
ry: 10;
}
.service {
fill: #e8f5e9;
stroke: #388e3c;
stroke-width: 2;
rx: 10;
ry: 10;
}
.system {
fill: #fff3e0;
stroke: #ef6c00;
stroke-width: 2;
rx: 10;
ry: 10;
}
</style>
<!-- Main system container -->
<rect x="50" y="50" width="1100" height="700" class="system" fill="#fff3e0"/>
<text x="600" y="40" class="label" text-anchor="middle">Qwen Image Edit Rapid-AIO v23 System</text>
<!-- Database Component -->
<rect x="850" y="150" width="200" height="100" class="database"/>
<text x="950" y="170" class="label">PostgreSQL Database</text>
<text x="950" y="190" class="sublabel">host: 192.168.1.160</text>
<text x="950" y="210" class="sublabel">port: 5433</text>
<text x="950" y="230" class="sublabel">dbname: dv</text>
<!-- ComfyUI Backend Component -->
<rect x="850" y="300" width="200" height="100" class="component"/>
<text x="950" y="320" class="label">ComfyUI Backend</text>
<text x="950" y="340" class="sublabel">Qwen-Rapid-NSFW-v23</text>
<text x="950" y="360" class="sublabel">GGUF Model (21.8GB)</text>
<!-- API Service Component -->
<rect x="850" y="450" width="200" height="100" class="service"/>
<text x="950" y="470" class="label">FastAPI Service</text>
<text x="950" y="490" class="sublabel">edit_api.py</text>
<text x="950" y="510" class="sublabel">Image Processing</text>
<!-- Watcher Service Component -->
<rect x="850" y="600" width="200" height="100" class="service"/>
<text x="950" y="620" class="label">Folder Watcher</text>
<text x="950" y="640" class="sublabel">watcher.py</text>
<text x="950" y="660" class="sublabel">car.html Generator</text>
<!-- Input/Output Directories -->
<rect x="50" y="150" width="200" height="100" class="component"/>
<text x="150" y="170" class="label">Stage Directory</text>
<text x="150" y="190" class="sublabel">/mnt/zim/tour-comfy/stage</text>
<text x="150" y="210" class="sublabel">Input images</text>
<rect x="50" y="300" width="200" height="100" class="component"/>
<text x="150" y="320" class="label">Output Directory</text>
<text x="150" y="340" class="sublabel">/mnt/zim/tour-comfy/output</text>
<text x="150" y="360" class="sublabel">Processed images</text>
<rect x="50" y="450" width="200" height="100" class="component"/>
<text x="150" y="470" class="label">Failed Directory</text>
<text x="150" y="490" class="sublabel">/mnt/zim/tour-comfy/failed</text>
<text x="150" y="510" class="sublabel">Failed images</text>
<!-- System Services -->
<rect x="50" y="600" width="200" height="100" class="component"/>
<text x="150" y="620" class="label">System Services</text>
<text x="150" y="640" class="sublabel">comfyui.target</text>
<text x="150" y="660" class="sublabel">backend, api, watcher</text>
<!-- Connections -->
<line x1="350" y1="200" x2="850" y2="200" class="connection"/>
<text x="600" y="190" class="sublabel">Image Upload</text>
<line x1="350" y1="350" x2="850" y2="350" class="connection"/>
<text x="600" y="340" class="sublabel">Processing Request</text>
<line x1="350" y1="500" x2="850" y2="500" class="connection"/>
<text x="600" y="490" class="sublabel">Database Access</text>
<line x1="350" y1="650" x2="850" y2="650" class="connection"/>
<text x="600" y="640" class="sublabel">File Monitoring</text>
<!-- Arrowhead marker definition -->
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#757575"/>
</marker>
</defs>
<!-- Configuration Files -->
<rect x="400" y="50" width="200" height="80" class="component"/>
<text x="500" y="70" class="label">Configuration</text>
<text x="500" y="90" class="sublabel">config.json</text>
<text x="500" y="110" class="sublabel">API Settings</text>
<!-- Prompt Management -->
<rect x="400" y="200" width="200" height="80" class="component"/>
<text x="500" y="220" class="label">Prompt Management</text>
<text x="500" y="240" class="sublabel">prompt_pose_book.md</text>
<text x="500" y="260" class="sublabel">Base prompts</text>
<!-- GFPGAN Component -->
<rect x="400" y="350" width="200" height="80" class="component"/>
<text x="500" y="370" class="label">GFPGAN Face Restoration</text>
<text x="500" y="390" class="sublabel">gfpgan directory</text>
<text x="500" y="410" class="sublabel">Face swap functionality</text>
<!-- System Target -->
<rect x="400" y="600" width="200" height="80" class="component"/>
<text x="500" y="620" class="label">System Target</text>
<text x="500" y="640" class="sublabel">comfyui.target</text>
<text x="500" y="660" class="sublabel">Service orchestration</text>
<!-- Connection between system components -->
<line x1="600" y1="130" x2="600" y2="150" class="connection"/>
<line x1="600" y1="280" x2="600" y2="300" class="connection"/>
<line x1="600" y1="430" x2="600" y2="450" class="connection"/>
<line x1="600" y1="580" x2="600" y2="600" class="connection"/>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

169
.trash/deploy_api.sh Executable file
View File

@@ -0,0 +1,169 @@
#!/bin/bash
# Deploy/stop/restart/status tour-comfy project on the tour machine.
#
# Usage:
# ./deploy_api.sh
# ./deploy_api.sh deploy tour|hubby|all
# ./deploy_api.sh stop tour|hubby|all
# ./deploy_api.sh restart tour|hubby|all
# ./deploy_api.sh status tour|hubby|all
set -euo pipefail
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
ACTION="${1:-deploy}"
TARGET="${2:-tour}"
REMOTES=()
TOUR_SPEC="tour@192.168.1.160:/media/tour/APPS/comfyui/api"
HUBBY_SPEC="hubby@192.168.1.171:/home/hubby/comfyui/api"
case "$TARGET" in
tour) REMOTES=("$TOUR_SPEC") ;;
hubby) REMOTES=("$HUBBY_SPEC") ;;
all) REMOTES=("$TOUR_SPEC" "$HUBBY_SPEC") ;;
*)
echo "Usage: $0 [deploy|stop|restart|status] [tour|hubby|all]"
exit 1
;;
esac
print_header() {
local title="$1"
echo
echo "============================================================"
echo "$title"
echo "============================================================"
}
stop_one() {
local REMOTE_SPEC="$1"
local REMOTE="${REMOTE_SPEC%%:*}"
local REMOTE_DIR="${REMOTE_SPEC##*:}"
print_header "Stopping services on $REMOTE"
ssh "$REMOTE" "sudo bash $REMOTE_DIR/stop.sh"
}
deploy_one() {
local REMOTE_SPEC="$1"
local REMOTE="${REMOTE_SPEC%%:*}"
local REMOTE_DIR="${REMOTE_SPEC##*:}"
print_header "Deploying to $REMOTE"
echo "==> Creating remote directory..."
ssh "$REMOTE" "mkdir -p $REMOTE_DIR"
echo "==> Syncing project files..."
# Ship code + config only; never the local test images, watcher data dirs,
# logs, or runtime state.
rsync -avz \
--exclude 'deploy_api.sh' \
--exclude '*.png' \
--exclude '*.log' \
--exclude 'processed.json' \
--exclude 'stage/' --exclude 'out/' --exclude 'output/' --exclude 'failed/' \
--exclude '__pycache__/' --exclude '*.pyc' --exclude '*.tmp' \
"$SCRIPT_DIR/" "$REMOTE:$REMOTE_DIR/"
echo "==> Bootstrapping host (venv/ComfyUI/models; idempotent — first run downloads ~31GB)..."
ssh "$REMOTE" "bash $REMOTE_DIR/bootstrap.sh"
echo "==> Installing/refreshing systemd services..."
ssh "$REMOTE" "sudo bash $REMOTE_DIR/deploy.sh"
echo "==> Waiting for API startup (port 8500)..."
for i in {1..60}; do
if ssh "$REMOTE" "curl -fsS http://localhost:8500/health >/dev/null 2>&1"; then
echo "==> API is ready"
break
fi
if [ "$i" -eq 60 ]; then
echo
echo "ERROR: API failed to become healthy on $REMOTE"
echo
echo "Check logs with: ssh $REMOTE 'journalctl -u comfyui-api -n 50'"
exit 1
fi
sleep 2
done
echo
echo "==> Health check:"
ssh "$REMOTE" "curl -s http://localhost:8500/health | python3 -m json.tool"
echo
echo "==> Service Status:"
ssh "$REMOTE" "systemctl status comfyui-backend comfyui-api --no-pager || true"
}
status_one() {
local REMOTE_SPEC="$1"
local REMOTE="${REMOTE_SPEC%%:*}"
local REMOTE_DIR="${REMOTE_SPEC##*:}"
print_header "Status on $REMOTE"
ssh "$REMOTE" "
echo '==> Systemd Services:'
systemctl status comfyui-backend comfyui-api --no-pager || true
echo
echo '==> Health (8500):'
curl -fsS http://localhost:8500/health 2>/dev/null | python3 -m json.tool || echo 'not healthy'
echo
echo '==> Last 10 backend logs:'
journalctl -u comfyui-backend -n 10 --no-pager
echo
echo '==> Last 10 API logs:'
journalctl -u comfyui-api -n 10 --no-pager
"
}
case "$ACTION" in
deploy)
for REMOTE in "${REMOTES[@]}"; do
deploy_one "$REMOTE"
done
echo
echo "All deployments completed successfully."
;;
stop)
for REMOTE in "${REMOTES[@]}"; do
stop_one "$REMOTE"
done
echo
echo "All services stopped."
;;
restart)
for REMOTE in "${REMOTES[@]}"; do
# deploy_one already handles restart via deploy.sh
deploy_one "$REMOTE"
done
echo
echo "All services restarted successfully."
;;
status)
for REMOTE in "${REMOTES[@]}"; do
status_one "$REMOTE"
done
;;
*)
echo "Usage: $0 [deploy|stop|restart|status] [tour|hubby|all]"
exit 1
;;
esac

View File

@@ -0,0 +1,11 @@
#,Pose,Base,Key Action,Mood
9,**The Bridge**,Supine,"Hips lifted high, body arched","Strong, open"
10,**The Lotus (recline)**,Supine,"Legs crossed in lotus, knees open","Centered, tranquil"
11,**The Archer**,Side-lying,"Top leg bent, hand grasps ankle, bow shape","Tense, focused"
12,**The Crescent**,Kneeling/standing,"Deep backbend, arms overhead, hips forward","Expansive, vulnerable"
13,**The Cocoon**,Side-lying,"Fetal curl, arms wrapped around legs","Protected, intimate"
14,**The Swan Dive**,Prone,"Chest and legs lifted, arms forward","Graceful, soaring"
15,**The Suspended Split**,Supine,Legs vertical and spread wide in full split,"Flexible, exposed"
16,**The Embrace**,Seated,"Folded forward over legs, arms wrapped around","Intimate, yielding"
17,**The Cascade**,Seated,Twisted fold over one extended leg,"Fluid, surrendered"
18,**The Flame**,Standing,"One-legged balance, arms overhead","Poised, burning"
1 # Pose Base Key Action Mood
2 9 **The Bridge** Supine Hips lifted high, body arched Strong, open
3 10 **The Lotus (recline)** Supine Legs crossed in lotus, knees open Centered, tranquil
4 11 **The Archer** Side-lying Top leg bent, hand grasps ankle, bow shape Tense, focused
5 12 **The Crescent** Kneeling/standing Deep backbend, arms overhead, hips forward Expansive, vulnerable
6 13 **The Cocoon** Side-lying Fetal curl, arms wrapped around legs Protected, intimate
7 14 **The Swan Dive** Prone Chest and legs lifted, arms forward Graceful, soaring
8 15 **The Suspended Split** Supine Legs vertical and spread wide in full split Flexible, exposed
9 16 **The Embrace** Seated Folded forward over legs, arms wrapped around Intimate, yielding
10 17 **The Cascade** Seated Twisted fold over one extended leg Fluid, surrendered
11 18 **The Flame** Standing One-legged balance, arms overhead Poised, burning