File size: 1,270 Bytes
9ca6476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba4b7cb
 
9ca6476
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""FLUX.2 Klein 9B Edit — powered by WaveSpeed AI.

Generated from _shared/apps.py — edit the spec there, not this file.
"""

import os

# Set before gradio is imported: its telemetry client reads these at import time.
os.environ.setdefault("GRADIO_ANALYTICS_ENABLED", "False")
os.environ.setdefault("HF_HUB_DISABLE_TELEMETRY", "1")

from pathlib import Path  # noqa: E402

import spaceui  # noqa: E402

SPEC = {
    "title": "FLUX.2 Klein 9B Edit",
    "model": "wavespeed-ai/flux-2-klein-9b/edit",
    "output": "image",
    "tagline": "Instruction-driven editing with FLUX.2 Klein 9B.",
    "fields": [
        {
            "kind": "images",
            "key": "images",
            "label": "Input image"
        },
        {
            "kind": "prompt",
            "key": "prompt",
            "label": "Prompt",
            "placeholder": "Describe the edit to apply"
        },
        {
            "kind": "seed",
            "key": "seed"
        }
    ],
    "extra": {
        "enable_base64_output": False,
        "enable_sync_mode": False
    },
    "campaign": "flux2_klein_9b_edit"
}

SPEC["css"] = Path(__file__).with_name("style.css").read_text(encoding="utf-8")

if __name__ == "__main__":
    spaceui.launch(spaceui.build(SPEC), SPEC["css"])