Avatar

@fal

4 public vals
Joined February 6, 2024
fal.ai - fast matrix multiplication
1
2
3
import WebcamPage from "https://esm.sh/gh/fal-ai/fal-js@9cc7cf5456/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx";
console.log(WebcamPage.toString());

Stable Video Diffusion

link to val - https://www.val.town/v/fal/svd

import * as fal from "@fal-ai/serverless-client";

const result = await fal.subscribe("fal-ai/fast-svd", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
}); 

https://www.fal.ai/models/svd/playground

rocket.png

Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import fal from "npm:@fal-ai/serverless-client";
export let sd_video = async (
image_url: string,
motion_bucket_id: number = 127,
cond_aug: number = 0.02,
steps: number = 20,
deep_cache: string = "minimum",
fps: number = 10,
): Promise<{ video: { url: string } }> => {
return await fal.subscribe("fal-ai/fast-svd", {
input: {
image_url: image_url,
motion_bucket_id: motion_bucket_id,
cond_aug: cond_aug,
steps: steps,
deep_cache: deep_cache,
fps: fps,
},
});
};

Creative Upscaler

link to val - https://www.val.town/v/fal/creative_upscaler

Usage

const upscaledImage = @fal.creative_upscaler("an owl", "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png") 

Usage

import fal from "npm:@fal-ai/serverless-client";

const result = await fal.subscribe("fal-ai/creative-upscaler", {
  input: {
      prompt: "an owl",
      image_url: "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png",
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});

https://www.fal.ai/models/creative-upscaler

owl.png

Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import fal from "npm:@fal-ai/serverless-client";
export let creativeUpscaler = async (
prompt: string,
image_url: string,
creativity: number = 0.5,
detail: number = 1,
shape_preservation: number = 1.5,
negative_prompt: string =
"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy",
seed: number = 42,
guidance_scale: number = 7.5,
num_inference_steps: number = 20,
enable_safety_checks: boolean = true,
): Promise<{ image: { url: string } }> => {
return await fal.subscribe("fal-ai/creative-upscaler", {
input: {
prompt: prompt,
image_url: image_url,
creativity: creativity,
detail: detail,
shape_preservation: shape_preservation,
negative_prompt: negative_prompt,
seed: seed,
guidance_scale: guidance_scale,
num_inference_steps: num_inference_steps,
enable_safety_checks: enable_safety_checks,
},
});
};

SDXL (fastest)

https://www.fal.ai/models/stable-diffusion-xl

link to val - https://www.val.town/v/fal/sdxl

import * as fal from "npm:@fal-ai/serverless-client";

const result = await fal.subscribe("fal-ai/fast-sdxl", {
  input: {
    prompt: "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});

cheetah.png

Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import fal from "npm:@fal-ai/serverless-client";
export let sdxl = async (
prompt: string,
negative_prompt: string = "cartoon, illustration, animation. face. male, female",
image_size: string = "square_hd",
num_inference_steps: number = 25,
guidance_scale: number = 7.5,
num_images: number = 1,
loras: [string] = [],
): Promise<{ images: [{ url: string }] }> => {
return await fal.subscribe("fal-ai/fast-sdxl", {
input: {
prompt: prompt,
negative_prompt: negative_prompt,
image_size: image_size,
num_inference_steps: num_inference_steps,
guidance_scale: guidance_scale,
num_images: num_images,
loras: [],
},
});
};
Next