visual-gen-fallback
Infographic fallback when renderer or vision is unavailable.
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- visual-gen-fallback
- license
- MIT
- version
- 1.0.0
- platforms
- [ "linux", "macos", "windows" ]
- description
- Infographic fallback when renderer or vision is unavailable.
03 SKILL.md 正文
Visual Asset Generation Without a Renderer (Fallback)
Use this when a user wants a generated visual (infographic, social graphic, image with a
brand character) but the agent has no image_generate tool, no local diffusion
backend (ComfyUI absent, no GPU), and/or vision_analyze is unavailable. Do NOT hang
or fabricate output. Take the available path and report blockers as actionable asks.
Decision: can I render at all?
image_generatein toolset? → use it (seebaoyu-infographic/comfyuiskills).- Local ComfyUI on
:8188+comfyCLI + GPU? →comfyuiskill (best for exact brand match via Flux/SDXL img2img with the reference image). - Comfy Cloud API key + paid tier? →
comfyuiskill againsthttps://cloud.comfy.org(also good for exact match). - None of the above → use the NotebookLM fallback below.
Step 1 — Characterize the reference image WITHOUT vision (PIL fallback)
vision_analyze may fail with 404 (file:// not readable by the vision backend) or 429
(rate-limited). Don't assume blindness — read pixels directly for the facts a generator
needs (transparency, dominant palette):
from PIL import Image
from collections import Counter
im = Image.open("character.png").convert("RGBA") # force alpha
w,h = im.size; px = im.load()
cnt = Counter()
for y in range(0,h,2):
for x in range(0,w,2):
r,g,b,a = px[x,y]
if a > 40: # skip transparent pixels
cnt[(r//24*24, g//24*24, b//24*24)] += 1
print("mode:", im.mode, "size:", im.size) # RGBA => transparent background
print("alpha extrema:", im.split()[-1].getextrema())
for (r,g,b),n in cnt.most_common(10):
print(f" #{r:02X}{g:02X}{b:02X} freq={n}")
This yields the factual palette + alpha info to brief any generator. (Example: a warm dark owl came out RGBA 360x360, transparent bg, maroon/rust/black dominant.)
Step 2 — Upload brief + reference image to NotebookLM, then generate
nlm source add --file accepts BOTH a .md/.txt brief and a .png/.jpg reference
(the image source type becomes image). Create a notebook, add both, generate:
NL=/home/deeone/.local/bin/nlm
NBID=$($NL notebook create "Infographic Pack" --json \
| grep -o '"notebook_id": *"[^"]*"' | sed 's/.*"notebook_id": *"//;s/"//')
$NL source add "$NBID" --file /path/to/brief.md --title "Brief" --wait
$NL source add "$NBID" --file /path/to/character.png --title "Brand Character (reference)" --wait
$NL infographic create "$NBID" --orientation portrait --style professional \
--focus "Hand-drawn doodle style, warm cozy colors, include the character pointing to tips" --confirm
(See nlm-productivity skill for the full nlm command surface, download-by-id, and rate
limits. Requires nlm CLI + auth.)
Caveat — fidelity: NotebookLM infographic generation produces layout/structure but will NOT pixel-match a brand character the way Flux/SDXL img2img would. If an exact visual match matters, you need a diffusion backend (Comfy Cloud key + img2img with the reference).
Step 3 — Report blockers as actionable asks (never a dead end)
When fully blocked, the user expects TWO things: (a) take the available path (e.g. upload to NotebookLM), AND (b) itemize each blocker with the exact unblock. Template:
- Vision 404 (file://): deliver the image as a MEDIA attachment the runtime decodes, or configure the vision backend to read local paths. (PIL fallback above avoids needing it.)
- Vision 429: wait out the cooldown, or use a vision-capable model/provider with quota.
- No image-generation backend: local ComfyUI absent on this host; Comfy Cloud needs a paid API key (best for exact match via Flux/SDXL img2img). Or any image-gen endpoint key (OpenAI/DALL·E, etc.).
Pitfalls
- PIL characterization must
convert("RGBA")before reading alpha; transparent pixels haveanear 0 — skip them (a > 40) or the histogram is dominated by the bg color. vision_analyze404 onfile://is NOT "image missing" — the file often exists; the vision backend just can't reach the local FS. Verify withsearch_files/file stat first.- NotebookLM infographic ≈ layout generator, not a character renderer. Don't promise brand fidelity from it.
nlmextraction withgrep ... | python3can trip a security scanner (pipe-to-interpreter). Prefergrep -o+sedto pull the ID without piping JSON into an interpreter.
See Also
nlm-productivity— full NotebookLM CLI surface (user-owned; recommendhermes curator adoptif you want to fold this in).comfyui— local/cloud diffusion when a renderer IS available (best for pixel-matching a brand character via img2img).baoyu-infographic— layout×style infographic planner that assumesimage_generateexists (bundled; protected).
04 同仓库更多 Skills
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
gemini-vision-fallback
Vision fallback: Gemini REST API if vision_analyze blocked.
twitter-cli
Use twitter-cli for ALL Twitter/X operations — reading tweets, posting, replying, quoting, liking, retweeting, following, searching, user lookups. Invoke whenever user requests any Twitter interaction.
prism-scan
Structural analysis through dynamically generated cognitive lenses. Generates the optimal analytical lens for the specific code/artifact, then executes it. Finds conservation laws, structural invariants, and concrete bugs that vanilla analysis misses. Use on any code file, system design, or text artifact.
prism-reflect
Constraint transparency: analyzes an artifact structurally, then analyzes what its own analysis concealed. Produces a conservation law AND a constraint report showing what was maximized, what was sacrificed, and what to investigate next. The only AI skill that knows what it can't see.
prism-full
Full Prism: multi-pass structural analysis with mandatory adversarial self-correction. Designs custom analytical passes, executes them with chaining, then attacks its own findings before synthesizing. Use for maximum depth on important code or artifacts.