Skip to main content
Module

x/stable_diffusion_client/src/utils.ts>toBase64

stable-diffusion-webui Client writen in Deno
Latest
function toBase64
import { toBase64 } from "https://deno.land/x/stable_diffusion_client@0.1.0/src/utils.ts";

Converts an image buffer to base64

Parameters

image: Sharp

image buffer to convert to base64

optional
raw: boolean = [UNSUPPORTED]

if true, returns the raw base64 string, if false, returns a data url with the base64 string

Returns

Promise<string>

base64 encoded image