Genai Vision logo

Genai Vision

Community
j4flmao
genai-vision

Use this skill when the user says 'generate images', 'Stable Diffusion', 'SDXL', 'FLUX', 'diffusers pipeline', 'image-to-image', 'inpainting', 'Whisper transcription', 'speech to image pipeline'. Implements local or self-hosted image generation with Hugging Face diffusers and speech transcription with Whisper, including memory optimization, reproducibility, licensing, and safety checks. Do NOT use for: vision-language understanding / VLM pipelines (rnd/ai-agents/multimodal-pipelines), training diffusion models from scratch (fundamental-truths/statistical-mechanics for theory), or classic CV tasks like detection (ml computer-vision skill).

Overview

Publisherj4flmao
Repositoryagent-skills
Skill namegenai-vision
Stars
41
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by j4flmao on GitHub. Read the source before you install it.

Installation

Install the Genai Vision AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/j4flmao/agent-skills/tree/main/skills/ai/genai-vision
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/ai/genai-vision .claude/skills/genai-vision
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Genai Vision in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Genai Vision on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Genai Vision is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

GenAI Vision & Audio

Purpose

Ship image generation and speech transcription with open models: pick a model whose license fits the use case, load it in half precision with sensible memory settings, make outputs reproducible, and wrap it in a service that handles queuing and safety. The diffusers library provides the image pipelines; Whisper (via faster-whisper or transformers) handles audio.

Agent Protocol

Trigger

"stable diffusion", "SDXL", "FLUX", "diffusers", "text-to-image", "img2img", "inpainting", "LoRA for SD", "Whisper", "transcribe audio".

Input Context

  • Use case (commercial or not), target quality, latency per image.
  • GPU (VRAM size) or CPU-only constraints.
  • Need for conditioning (img2img, inpainting, ControlNet, LoRA styles).
  • Audio language(s) and real-time vs batch transcription.

Output Artifact

Model choice with license note, pipeline code, memory/performance settings, serving outline.

Response Format

Model: {repo id}  License: {license}  VRAM: {approx}
Pipeline: {class}  dtype: {fp16|bf16}  Steps/guidance: {n}/{g}
Memory: {cpu offload|vae tiling|none}
Repro: seed={n} recorded with prompt + model revision
Audio: {whisper variant, compute_type}

Completion Criteria

  • License verified for intended use.
  • Device selected dynamically; half precision used on GPU.
  • Seed, model revision, and parameters logged per output.
  • Safety/NSFW policy defined for user-facing generation.

Model Selection (verify licenses on the model card before use)

Model familyNotesLicense (check card)
Stable Diffusion 1.5Small, huge LoRA ecosystem; original runwayml repo was removed, mirrors existCreativeML OpenRAIL-M
SDXL base 1.01024px, good quality/VRAM balanceCreativeML OpenRAIL++-M
SD 3.5 (Medium/Large)MMDiT architecture, better text renderingStability AI Community License (revenue threshold)
FLUX.1 [schnell]Few-step, high qualityApache-2.0
FLUX.1 [dev]Higher quality, guidance-distilledNon-commercial license

Text-to-Image (diffusers)

python
from __future__ import annotations

import json
import logging
from pathlib import Path

import torch
from diffusers import AutoPipelineForText2Image

log = logging.getLogger("genai")
MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0"


def pick_device() -> tuple[str, torch.dtype]:
    if torch.cuda.is_available():
        return "cuda", torch.float16
    if torch.backends.mps.is_available():
        return "mps", torch.float16
    return "cpu", torch.float32  # CPU kernels need fp32; expect minutes per image


def load_pipeline(low_vram: bool = False):
    device, dtype = pick_device()
    pipe = AutoPipelineForText2Image.from_pretrained(
        MODEL_ID, torch_dtype=dtype, variant="fp16" if dtype == torch.float16 else None,
        use_safetensors=True,
    )
    if low_vram and device == "cuda":
        pipe.enable_model_cpu_offload()   # needs `accelerate`; do not also call .to("cuda")
    else:
        pipe.to(device)
    return pipe, device


def generate(pipe, device: str, prompt: str, out: Path, seed: int = 0,
             steps: int = 30, guidance: float = 7.0, negative: str = "") -> Path:
    generator = torch.Generator(device="cpu" if device == "mps" else device).manual_seed(seed)
    image = pipe(prompt=prompt, negative_prompt=negative or None, num_inference_steps=steps,
                 guidance_scale=guidance, generator=generator).images[0]
    image.save(out)
    out.with_suffix(".json").write_text(json.dumps(
        {"model": MODEL_ID, "prompt": prompt, "negative": negative, "seed": seed,
         "steps": steps, "guidance": guidance}))
    log.info("generated %s seed=%d", out, seed)
    return out

Notes:

  • PyTorch 2.x uses scaled-dot-product attention by default; installing xformers is no longer required.
  • FLUX.1 [schnell] uses FluxPipeline, ~4 steps, guidance_scale=0.0.
  • Pin revision= on from_pretrained for reproducible production builds.

Conditioning Options

NeedTool
Edit an existing imageAutoPipelineForImage2Image (strength 0.3-0.8)
Replace a regionAutoPipelineForInpainting with a mask
Pose/edge/depth controlControlNet pipelines (StableDiffusionXLControlNetPipeline)
Style or subjectLoRA: pipe.load_lora_weights(path); scale via cross_attention_kwargs={"scale": 0.8} or adapter weights
Fast draftsDistilled/turbo models or LCM-LoRA with 4-8 steps

Memory & Speed

ProblemSetting
OOM on loadenable_model_cpu_offload(); smaller model; fp16 variant
OOM at high resolutionpipe.vae.enable_tiling() / enable_slicing()
ThroughputBatch prompts (num_images_per_prompt), torch.compile(pipe.unet) after warmup
LatencyFewer steps with a distilled model rather than cutting steps on a base model

Speech Transcription (Whisper)

python
from faster_whisper import WhisperModel   # CTranslate2 backend

def transcribe(path: str, device: str = "cuda") -> list[dict]:
    compute_type = "float16" if device == "cuda" else "int8"
    model = WhisperModel("large-v3", device=device, compute_type=compute_type)
    segments, info = model.transcribe(path, beam_size=5, vad_filter=True)
    return [{"start": s.start, "end": s.end, "text": s.text} for s in segments]

segments is a generator; transcription runs as you iterate. For lower latency use the turbo/distilled variants; for the Hugging Face stack use pipeline("automatic-speech-recognition", model="openai/whisper-large-v3-turbo").

Speech-to-Image Flow

Serving

  • Run the pipeline in a dedicated GPU worker; accept jobs via a queue (one model instance per GPU, batch where possible).
  • Return a job id immediately; generation takes seconds.
  • Cache loaded pipelines; loading SDXL takes far longer than one inference.
  • Apply prompt and output moderation for public endpoints; add provenance (C2PA metadata or visible/invisible watermark) where policy requires.

Anti-Patterns

  • Hardcoding .to("cuda") with no fallback.
  • Loading fp32 weights on GPU (double VRAM for no visible gain).
  • Calling .to("cuda") after enable_model_cpu_offload().
  • Using a non-commercial model in a commercial product.
  • Not storing seed/params: outputs cannot be reproduced or audited.

Checklist

  • Model license checked and recorded.
  • Dynamic device + fp16/bf16 on GPU; pinned revision.
  • Memory settings match VRAM.
  • Seed + params persisted with each image.
  • Queue-based GPU worker with timeouts.
  • Moderation and provenance for user-facing output.

References

  • Hugging Face diffusers documentation (AutoPipeline, memory optimization, LoRA loading).
  • Radford et al., "Robust Speech Recognition via Large-Scale Weak Supervision" (Whisper, 2022); SYSTRAN/faster-whisper.

Frequently asked questions

What does the Genai Vision AI skill do?

Use this skill when the user says 'generate images', 'Stable Diffusion', 'SDXL', 'FLUX', 'diffusers pipeline', 'image-to-image', 'inpainting', 'Whisper transcription', 'speech to image pipeline'. Implements local or self-hosted image generation with Hugging Face diffusers and speech transcription with Whisper, including memory optimization, reproducibility, licensing, and safety checks. Do NOT use for: vision-language understanding / VLM pipelines (rnd/ai-agents/multimodal-pipelines), training diffusion models from scratch (fundamental-truths/statistical-mechanics for theory), or classic CV...

Why use Genai Vision on TypingMind?

Because you install it once and use it with any model. Genai Vision is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Genai Vision in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/j4flmao/agent-skills/tree/main/skills/ai/genai-vision. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Genai Vision?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Genai Vision?

As many as you like. As long as a model supports skills, you can use Genai Vision with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Genai Vision AI skill free?

Yes. It is published on GitHub by j4flmao under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇