返回顶部
f

fal-image-gen

Call fal.ai model APIs for image generation (text-to-image and image-to-image). Use when a user asks to integrate fal, construct requests, run jobs, handle auth, or return image URLs from fal model APIs.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,552
下载量
1
收藏
概述
安装方式
版本历史

fal-image-gen

# Fal Image Gen ## Overview Use this skill to implement text-to-image or image-to-image calls against fal model APIs. Prioritize correctness by checking the current docs for the selected model’s required inputs/outputs and authentication requirements. ## Quick Start 1. Identify the target model ID from the fal model API docs. 2. Collect inputs from the user. - Text-to-image: `prompt`, optional `negative_prompt`, size/aspect, steps, seed, safety options. - Image-to-image: source image URL, strength/denoise, plus prompt/options above. 3. Pick the calling method. - If the user prefers SDKs: provide Python and/or JavaScript examples. - If the user prefers REST: provide a curl/HTTP example. 4. Execute the request and return image URL(s) from the response. ## Workflow: Text-to-Image 1. Resolve the model ID and schema. - Open the fal model API docs and confirm the exact input fields and output format. 2. Validate inputs. - Ensure prompt is non-empty and size/aspect settings are supported by the model. 3. Build the request. - SDK: call the SDK’s `run`/`submit` method with an `input` object. - REST: call the model endpoint with a JSON body that matches the schema. 4. Execute and parse output. - Extract image URL(s) from the response fields defined by the model. 5. Return URLs. - Provide a clean list of URLs and note any metadata the user asked for (seed, size, etc.). ## Workflow: Image-to-Image 1. Resolve the model ID and schema. 2. Validate inputs. - Ensure the source image is reachable by URL (or converted to the required format). - Confirm any strength/denoise range constraints from docs. 3. Build the request. - Include source image + prompt + other options as required by the model. 4. Execute and parse output. - Extract image URL(s) from the response fields defined by the model. 5. Return URLs. ## SDK vs REST Guidance - Prefer SDKs for simpler auth and retries. - Prefer REST when the user needs raw HTTP examples, or when running in environments without SDK support. - Never hardcode API keys. Follow the docs for the required environment variable or header name. ## Minimal Examples (Fill From Docs) Use these as templates only. Replace placeholders after checking the docs. ### Python (SDK) ```python # Pseudocode: replace with the exact fal SDK import + call pattern from docs import os # from fal import client # or the current SDK import MODEL_ID = "<model-id-from-docs>" input_data = { "prompt": "a cinematic photo of a red fox", # "image_url": "https://..." # for image-to-image # "negative_prompt": "...", # "width": 1024, # "height": 1024, } # result = client.run(MODEL_ID, input=input_data) # urls = extract_urls(result) ``` ### JavaScript (SDK) ```javascript // Pseudocode: replace with the exact fal SDK import + call pattern from docs // import { client } from "@fal-ai/client"; const MODEL_ID = "<model-id-from-docs>"; const input = { prompt: "a cinematic photo of a red fox", // image_url: "https://..." // for image-to-image }; // const result = await client.run(MODEL_ID, { input }); // const urls = extractUrls(result); ``` ### REST (curl) ```bash # Pseudocode: replace endpoint, headers, and payload schema from docs curl -X POST "https://<fal-api-base>/<model-endpoint>" \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "prompt": "a cinematic photo of a red fox" }' ``` ## Resources - `references/fal-model-api-checklist.md`: Checklist for gathering inputs and validating responses. - `references/fal-model-examples.md`: Example templates for text-to-image, image-to-image, and REST usage.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 falimagegen-1776362048 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 falimagegen-1776362048 技能

通过命令行安装

skillhub install falimagegen-1776362048

下载 Zip 包

⬇ 下载 fal-image-gen v1.0.0

文件大小: 4.31 KB | 发布时间: 2026-4-17 16:03

v1.0.0 最新 2026-4-17 16:03
Initial release of fal-image-gen skill:

- Provides structured guidance for integrating fal.ai model APIs for both text-to-image and image-to-image generation.
- Includes detailed step-by-step workflows for validating inputs, constructing requests, executing calls, and handling responses.
- Covers SDK and REST usage, recommending best practices for authentication and environment configuration.
- Offers Python, JavaScript, and curl request templates to help users get started quickly.
- References additional resource files with checklists and example templates.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部