Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
db05c24
1
Parent(s):
a73db4f
fix for image upscae
Browse files
src/providers/image-upscaling/upscaleImage.mts
CHANGED
@@ -5,6 +5,7 @@ import { getValidNumber } from "../../utils/validators/getValidNumber.mts"
|
|
5 |
|
6 |
// we don't use replicas yet, because it ain't easy to get their hostname
|
7 |
const instance = `${process.env.VC_UPSCALING_SPACE_API_URL || ""}`
|
|
|
8 |
|
9 |
// this doesn't work because of this error.. I think the version of Gradio is too old/young?
|
10 |
// ReferenceError: addEventListener is not defined
|
@@ -26,6 +27,7 @@ export async function upscaleImage(src: string, factor?: number) {
|
|
26 |
})
|
27 |
|
28 |
const result = await api.predict("/upscale", [
|
|
|
29 |
src, // blob in 'Source Image' Image component
|
30 |
"realesr-general-x4v3", // string (Option from: ['RealESRGAN_x4plus', 'RealESRNet_x4plus', 'RealESRGAN_x4plus_anime_6B', 'RealESRGAN_x2plus', 'realesr-general-x4v3']) in 'Real-ESRGAN inference model to be used' Dropdown component
|
31 |
0.5, // number (numeric value between 0 and 1) in 'Denoise Strength (Used only with the realesr-general-x4v3 model)' Slider component
|
|
|
5 |
|
6 |
// we don't use replicas yet, because it ain't easy to get their hostname
|
7 |
const instance = `${process.env.VC_UPSCALING_SPACE_API_URL || ""}`
|
8 |
+
const secretToken = `${process.env.VC_MICROSERVICE_SECRET_TOKEN || ""}`
|
9 |
|
10 |
// this doesn't work because of this error.. I think the version of Gradio is too old/young?
|
11 |
// ReferenceError: addEventListener is not defined
|
|
|
27 |
})
|
28 |
|
29 |
const result = await api.predict("/upscale", [
|
30 |
+
secretToken,
|
31 |
src, // blob in 'Source Image' Image component
|
32 |
"realesr-general-x4v3", // string (Option from: ['RealESRGAN_x4plus', 'RealESRNet_x4plus', 'RealESRGAN_x4plus_anime_6B', 'RealESRGAN_x2plus', 'realesr-general-x4v3']) in 'Real-ESRGAN inference model to be used' Dropdown component
|
33 |
0.5, // number (numeric value between 0 and 1) in 'Denoise Strength (Used only with the realesr-general-x4v3 model)' Slider component
|