Val Town Blog 10月02日 20:55
Val Town与Fal合作,简化AI图像生成
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Val Town宣布与Fal合作,将Fal的AI图像生成API集成到Val Town平台,用户无需API密钥即可在vals中直接使用Fal。通过fork starter apps或复制粘贴指令到Townie,用户可快速部署图像生成应用,如DnD角色生成器或纹身设计工具。Fal支持Flux系列模型,用户可切换不同模型。此合作主要面向原型设计和小规模项目,免费用户每小时限10次请求,Pro用户限50次。Fal API密钥注册适用于需要更大规模的项目。

🔧 Val Town与Fal合作,将Fal的AI图像生成API集成到Val Town平台,用户无需API密钥即可直接使用Fal,简化了开发流程。

🚀 用户可通过fork starter apps或复制粘贴指令到Townie快速部署图像生成应用,如DnD角色生成器或纹身设计工具,降低了使用门槛。

🌐 Fal支持Flux系列模型,用户可根据需求切换不同模型,如Flux Schnell(12b参数),提供多样化的图像生成选项。

📈 此合作主要面向原型设计和小规模项目,免费用户每小时限10次请求,Pro用户限50次,适合早期开发测试。

🔑 对于需要更大规模的项目,用户可注册Fal API密钥,通过代理服务使用更高级的功能,扩展应用潜力。

Val Town + Fal Partnership

on

Fal is an API for generating AI images lightning fast.

Today we’re announcing a partnership with Fal to bring their API to Val Town users. You can now use Fal in your vals right away – no Fal API key necessary.

The quickest way to get started is to fork one of these starter apps:

Click “Fork” on either of these apps, and you’ll instantly get that app deployed in your Val Town account. No further setup necessary. You can then ask Townie to customize it to your needs. Want a DnD character generator? No problem! Want a tool to help you design your next tattoo? Done!

Another quick way to get started is to copy & paste instructions into Townie. The following instructions will give Townie everything it needs to use Flux Schnell,a state-of-the-art 12b parameter image model by Black Forest Labs.Fal supports the whole Flux suite, and you can use any of them by changing the FAL_ENDPOINT variable.

The following are instructions on how to use Fal,

an image generation API, in your Val Town app.

Import the necessary modules:

import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";

import { createFalClient } from "https://esm.sh/@fal-ai/client";

Set up the Fal client on the client side:

const FAL_ENDPOINT = "fal-ai/flux/schnell";

const fal = createFalClient({

proxyUrl: "/api/fal/proxy",

Use the Fal client to handle image generation requests on the client:

const result = await fal.subscribe("fal-ai/flux/schnell", {

image_size: "landscape_4_3",

num_inference_steps: 4, // must be 12 or less

enable_safety_checker: true,

const image_url = result.data.images[0].url;

Set up the Fal proxy request on the server side:

export default async function server(req: Request): Promise<Response> {

const url = new URL(req.url);

if (url.pathname === "/") {

if (url.pathname === "/api/fal/proxy") {

return falProxyRequest(req);

This partnership is intended for prototyping and small-scale projects, and is rate-limited as follows:

    Val Town Free Users: 10 requests per hourVal Town Pro Users: 50 requests per hour

When your project needs scale, you can sign up for a Fal API key here.

Normally to use the Fal API, you’d need to sign up for an API key on their website, but with this partnership, you can start prototyping with Fal in your vals without any setup. This is possible because we’re proxying requests to the Fal API through this HTTP val, which uses your Val Town API token to authenticate and rate-limit you. In this way you’re using your Val Town API key in place of a Fal API key.

This is how our OpenAI integration works as well, through this proxy. I recently built a similar proxy for SocialData, a Twitter data API provider, which Val Town Pro users can use to run this twitterAlert notifying.

We think of these ‘userspace proxies’ as the beginnings of what we hope will become ‘Val Town Marketplace’. If you want to bring your API to Val Town users, email me at steve@val.town.

Edit this page

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Val Town Fal AI图像生成 API集成 原型设计
相关文章