Spaces:
Running
Running
Default portraits to Klein ZeroGPU
Browse files- web/imagen.js +2 -2
web/imagen.js
CHANGED
|
@@ -5,14 +5,14 @@ import { engineLocal as zimagelocal, engineKleinZeroGpu as klein, engineCloud as
|
|
| 5 |
import { engine as bonsai } from '/web/imagenBonsai.js'
|
| 6 |
|
| 7 |
const ENGINES = [zimagelocal, klein, bonsai, flux, fluxdev]
|
| 8 |
-
// Default: local Z-Image on localhost (your GPU),
|
| 9 |
// refreshes; a saved choice wins if it's still available.
|
| 10 |
const KEY = 'tinyarmy.imageEngine'
|
| 11 |
let activeId = (() => {
|
| 12 |
let saved = ''
|
| 13 |
try { saved = localStorage.getItem(KEY) || '' } catch { /* ignore */ }
|
| 14 |
const e = ENGINES.find((x) => x.id === saved)
|
| 15 |
-
return e && e.available() ? saved : (isLocalhost() ? 'zimage-local' : '
|
| 16 |
})()
|
| 17 |
|
| 18 |
const eng = () => ENGINES.find((e) => e.id === activeId) || ENGINES.find((e) => e.available()) || ENGINES[0]
|
|
|
|
| 5 |
import { engine as bonsai } from '/web/imagenBonsai.js'
|
| 6 |
|
| 7 |
const ENGINES = [zimagelocal, klein, bonsai, flux, fluxdev]
|
| 8 |
+
// Default: local Z-Image on localhost (your GPU), Klein ZeroGPU in prod. Persisted across
|
| 9 |
// refreshes; a saved choice wins if it's still available.
|
| 10 |
const KEY = 'tinyarmy.imageEngine'
|
| 11 |
let activeId = (() => {
|
| 12 |
let saved = ''
|
| 13 |
try { saved = localStorage.getItem(KEY) || '' } catch { /* ignore */ }
|
| 14 |
const e = ENGINES.find((x) => x.id === saved)
|
| 15 |
+
return e && e.available() ? saved : (isLocalhost() ? 'zimage-local' : 'klein-zerogpu')
|
| 16 |
})()
|
| 17 |
|
| 18 |
const eng = () => ENGINES.find((e) => e.id === activeId) || ENGINES.find((e) => e.available()) || ENGINES[0]
|