const oldImageUrl = "/old-photo.jpeg"
const oldImageResponse = await fetch(oldImageUrl)
const oldImageBlob = await oldImageResponse.blob()
const newImageBlob = await hf.imageToImage({
model: model,
inputs: oldImageBlob
})
const newImageBase64 = await blobToBase64(newImageBlob)
const newImage = document.getElementById("new-image")
newImage.src = newImageBase64
import { HfInference } from '@huggingface/inference'
// Create your Hugging Face Token: https://huggingface.co/settings/tokens
// Set your Hugging Face Token: https://scrimba.com/dashboard#env
// Learn more: https://scrimba.com/links/env-variables
const hf = new HfInference(process.env.HF_TOKEN)
// HuggingFace.js Inference docs
// https://huggingface.co/docs/huggingface.js/inference/README
const model = "ghoskno/Color-Canny-Controlnet-model"