From c2d54f7a4823ca0de99fdb8cc0a094b0cdf4cbb4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 24 Mar 2026 09:58:21 +0200 Subject: Add ComfyUI photo enhancement VM and photo-enhance.rb client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - hyperstack-vm-photo.toml: L40 GPU VM config (192.168.3.4, ~$1/hr) with [comfyui] section for port, model dirs, and pre-downloaded weights - hyperstack.rb: full ComfyUI provisioning support alongside vLLM/Ollama — config accessors, comfyui_install_script (git clone + venv + systemd), RemoteProvisioner#install_comfyui, Manager#create integration, UFW rules, status/service_mode_summary updates, --comfyui/--no-comfyui CLI flags - photo-enhance.rb: standalone client — uploads photos, submits ComfyUI workflow, polls for output, downloads PNG, converts to JPEG at quality 92 so file sizes match originals; --watch mode; processed-file manifest - workflows/photo-enhance.json: Real-ESRGAN x4plus enhance-in-place workflow (upscale 4x for enhancement, ImageScaleBy 0.25 back to original resolution) - README.md: Photo enhancement section with quickstart, config reference, workflow customisation notes, and performance table Co-Authored-By: Claude Sonnet 4.6 --- hyperstack-vm-photo.toml | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 hyperstack-vm-photo.toml (limited to 'hyperstack-vm-photo.toml') diff --git a/hyperstack-vm-photo.toml b/hyperstack-vm-photo.toml new file mode 100644 index 0000000..d6130b0 --- /dev/null +++ b/hyperstack-vm-photo.toml @@ -0,0 +1,68 @@ +[auth] +api_key_file = "~/.hyperstack" + +[hyperstack] +base_url = "https://infrahub-api.nexgencloud.com/v1" + +[state] +file = ".hyperstack-vm-photo-state.json" + +[vm] +name_prefix = "hyperstack-photo" +hostname = "hyperstack-photo" +environment_name = "snonux-ollama" + +# L40 (48GB GDDR6, ~$1.00/hr) is the recommended GPU for ComfyUI photo enhancement. +# It provides ample VRAM for SUPIR (FP16 needs ~12-20GB) + Real-ESRGAN with large tile sizes. +# Cheaper than A100 ($2/hr) while offering faster CUDA cores and FP8 support. +flavor_name = "n3-L40x1" +image_name = "Ubuntu Server 24.04 LTS R570 CUDA 12.8 with Docker" +assign_floating_ip = true +create_bootable_volume = false +enable_port_randomization = false +labels = ["comfyui", "photo-enhance", "wireguard"] + +[ssh] +username = "ubuntu" +private_key_path = "~/.ssh/id_rsa" +hyperstack_key_name = "earth" +port = 22 +connect_timeout_sec = 10 + +[network] +wireguard_udp_port = 56710 +wireguard_subnet = "192.168.3.0/24" +# Photo VM uses .4; VM1=.1, VM2=.3 are the LLM VMs on the same wg1 tunnel. +wireguard_server_ip = "192.168.3.4" +# Reuse the same inference port constant; ComfyUI uses its own port 8188 below. +ollama_port = 11434 +allowed_ssh_cidrs = ["auto"] +allowed_wireguard_cidrs = ["auto"] + +[bootstrap] +enable_guest_bootstrap = true +install_wireguard = true +configure_ufw = true +configure_ollama_host = false + +[ollama] +# Not needed on this VM; photo enhancement uses ComfyUI exclusively. +install = false + +[vllm] +# Not needed on this VM; ComfyUI handles all inference. +install = false + +[comfyui] +install = true +# ComfyUI REST API port — opened on the WireGuard subnet only. +port = 8188 +# Model weights on ephemeral NVMe for fast access; survives reboots on Hyperstack. +models_dir = "/ephemeral/comfyui/models" +output_dir = "/ephemeral/comfyui/output" +container_name = "comfyui_photo" +# Pre-downloaded model weights: +# RealESRGAN_x4plus — fast 4x upscaling + sharpening (~65MB, upscale_models/) +# SUPIR-v0Q — SDXL-based photo restoration, Photolemur-quality results (~8GB, checkpoints/) +# SUPIR-v0F — SUPIR variant tuned for faithful fidelity over generative enhancement (~8GB) +models = ["RealESRGAN_x4plus", "SUPIR-v0Q"] -- cgit v1.2.3