Genai Visionのロゴ

Genai Vision

コミュニティ
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).

概要

公開者j4flmao
リポジトリagent-skills
スキル名genai-vision
スター
41
フォーク
6
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    j4flmaoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Genai Vision」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/j4flmao/agent-skills/tree/main/skills/ai/genai-vision
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでGenai Visionを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGenai Visionを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Genai Visionは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

よくある質問

AIスキル「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...

TypingMindでGenai Visionを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Genai Visionはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにGenai Visionをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/j4flmao/agent-skills/tree/main/skills/ai/genai-visionを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Genai Visionを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Genai Visionで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGenai Visionを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Genai Vision」は無料ですか?

はい。j4flmaoがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇