tutorial

Monitoring Fooocus with Vigilmon

Fooocus is a Midjourney-style SDXL image generation interface with an async task queue and optional API mode. Here's how to monitor Gradio availability, the API layer, GPU memory health, and SSL certificates with Vigilmon.

Fooocus is an open-source Stable Diffusion XL image generation interface that strips away complex parameter tuning in favor of intelligent defaults and high-quality outputs — a deliberately simple UI that runs fully locally. It uses an async task queue, provides a Gradio web interface on port 7865, and offers an optional REST API via the --enable-api flag. With its large SDXL model footprint (8GB+ VRAM), a running Fooocus instance is worth watching carefully: GPU memory pressure, model loading failures, and Gradio server crashes can all take it offline. Vigilmon gives you Gradio availability monitoring, API health checks, GPU memory heartbeats, and SSL certificate alerts for every Fooocus deployment.

What You'll Set Up

  • HTTP uptime monitor for the Fooocus Gradio web UI (port 7865)
  • REST API path availability monitor confirming API mode is active
  • SSL certificate expiry alerts for HTTPS-proxied Fooocus deployments
  • Cron heartbeat for Fooocus GPU memory and model pipeline health

Prerequisites

  • Fooocus installed and running (default port 7865)
  • API mode enabled if you plan to use API monitors (--enable-api flag at startup)
  • Network access to the Fooocus host (direct or via reverse proxy)
  • A free Vigilmon account

Step 1: Monitor the Fooocus Gradio Web UI

Fooocus runs a Gradio server on port 7865 by default. A 200 response on the root path confirms the Gradio server has started and the SDXL model has been loaded into memory — Fooocus doesn't accept any requests until the model pipeline is ready.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the Fooocus URL: http://your-server-ip:7865 (or your proxied domain https://fooocus.yourdomain.com).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

By default Fooocus binds to 127.0.0.1. To monitor it remotely, launch with the --listen flag:

python launch.py --listen --port 7865

Or use a reverse proxy to expose it securely (see Step 4).


Step 2: Monitor the API Endpoint Availability

When Fooocus is launched with --enable-api, it exposes REST API endpoints for programmatic image generation. The /api/v1/generation/text-to-image-with-ip endpoint is a reliable API availability check: posting an empty body returns 422 Unprocessable Entity (body validation error), which confirms the API route is live and the generation service is running even without a valid payload.

  1. Click Add Monitor in Vigilmon.
  2. Set Type to HTTP / HTTPS.
  3. Enter: http://your-server-ip:7865/api/v1/generation/text-to-image-with-ip
  4. Set Method to POST.
  5. Set Expected HTTP status to 422.
  6. Set Check interval to 2 minutes.
  7. Click Save.

A 422 confirms the API route exists and is processing requests — a 404 or connection failure means the API mode is not active or Fooocus is down.

To confirm API mode is active before setting up the monitor:

curl -s -o /dev/null -w "%{http_code}" \
  -X POST http://your-server-ip:7865/api/v1/generation/text-to-image-with-ip \
  -H "Content-Type: application/json" -d '{}'
# Expected: 422

Step 3: Verify API Task Submission is Operational

As an additional API health check, you can confirm Fooocus is accepting generation task submissions by sending a minimal valid POST to /api/v1/generation/text-to-image. A successful response includes a task ID, confirming the generation service is accepting work items in the async queue.

Add a script-based check to your monitoring setup:

#!/bin/bash
# fooocus-api-check.sh — confirms task submission works

API="http://127.0.0.1:7865/api/v1/generation/text-to-image"

response=$(curl -sf --max-time 15 -X POST "$API" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "health check", "negative_prompt": "", "style_selections": [], "performance_selection": "Speed", "aspect_ratios_selection": "1152×896", "image_number": 1, "sharpness": 2.0, "guidance_scale": 4.0}')

if echo "$response" | grep -q '"job_id"'; then
    echo "API operational — task accepted"
else
    echo "API check failed"
    exit 1
fi

This confirms the full API stack — routing, request parsing, and queue submission — is operational. Run it as part of your deployment verification or periodic health checks.


Step 4: SSL Certificate Alerts for HTTPS Deployments

Fooocus is often deployed on a remote GPU server and accessed over the internet, making TLS essential. When running behind a reverse proxy, certificate expiry silently breaks access to the Gradio UI.

Add a certificate expiry monitor for your Fooocus domain:

  1. Open the HTTP monitor for your proxied Fooocus domain (created in Step 1).
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

A sample Caddy configuration for Fooocus (Caddy handles Let's Encrypt automatically):

fooocus.yourdomain.com {
    reverse_proxy localhost:7865
}

Or with nginx:

server {
    listen 443 ssl;
    server_name fooocus.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/fooocus.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/fooocus.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:7865;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
    }
}

The long proxy_read_timeout accounts for SDXL generation times, which can be 30–120 seconds depending on resolution and sampler settings.


Step 5: Heartbeat Monitoring for GPU Memory Health

Fooocus loads the SDXL base model, refiner, and ControlNet models — a pipeline that requires 8GB+ VRAM. Out-of-memory crashes are a common failure mode: the API routes go silent while the Gradio UI may still partially respond. Monitoring the /api/v1/generation/image-prompt-with-face-swap API route availability with --enable-api provides a signal for whether the full model pipeline remains in VRAM and accessible.

Set up a cron heartbeat to periodically verify the model pipeline is healthy:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 15 minutes.
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).

Create a script that probes the model pipeline route and pings the heartbeat when it confirms the route is accessible:

#!/bin/bash
# fooocus-gpu-heartbeat.sh — run via cron every 15 minutes

API="http://127.0.0.1:7865/api/v1/generation/image-prompt-with-face-swap"
HEARTBEAT="https://vigilmon.online/heartbeat/abc123"

# A POST with empty body returns 422 if the route and model pipeline are live
http_code=$(curl -sf --max-time 10 -o /dev/null -w "%{http_code}" \
  -X POST "$API" -H "Content-Type: application/json" -d '{}')

if [ "$http_code" = "422" ]; then
    curl -sf "$HEARTBEAT" > /dev/null
fi

Add to crontab:

*/15 * * * * /path/to/fooocus-gpu-heartbeat.sh

A 422 from the face-swap route confirms the full model pipeline — SDXL base, refiner, and ControlNet — is loaded and the API is accessible. An OOM crash causes Fooocus to exit or stop responding, and Vigilmon alerts after 15 minutes of missed heartbeats.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a webhook.
  2. Set Consecutive failures before alert to 2 on the Gradio UI monitor — SDXL model loading at startup takes 60–180 seconds, so allow one missed check during cold start.
  3. On the API availability monitor (Step 2), set Consecutive failures to 1 — a 404 or connection failure instead of 422 always signals a real problem.
  4. For the GPU memory heartbeat, a single missed window is actionable — VRAM OOM crashes don't self-recover without a process restart.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Gradio UI | http://host:7865/ | Gradio crash, SDXL model load failure | | API availability | /api/v1/generation/text-to-image-with-ip (POST→422) | API mode not active, route down | | GPU heartbeat | /api/v1/generation/image-prompt-with-face-swap cron | VRAM OOM crash, model pipeline failure | | SSL certificate | HTTPS proxied domain | Let's Encrypt renewal failure |

Fooocus makes SDXL image generation as simple as Midjourney — but running it locally means you own the reliability. With Vigilmon watching the Gradio interface, the API layer, the GPU memory health, and your SSL certificates, you get the observability layer that keeps your Fooocus instance generating.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →