WaveSpeedAI
Interactive BYOK demo for
d5ad893
Raw History Blame Contribute Delete
1.68 kB
"""GPT Image 2 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": "GPT Image 2 Edit",
"model": "openai/gpt-image-2/edit",
"output": "image",
"tagline": "Edit an existing image with GPT Image 2.",
"fields": [
{
"kind": "images",
"key": "images",
"label": "Input image"
},
{
"kind": "prompt",
"key": "prompt",
"label": "Prompt",
"placeholder": "Describe the edit to apply"
},
{
"kind": "choice",
"key": "resolution",
"label": "Resolution",
"choices": [
"1k",
"2k",
"4k"
],
"default": "1k"
},
{
"kind": "choice",
"key": "quality",
"label": "Quality",
"choices": [
"low",
"medium",
"high"
],
"default": "medium"
}
],
"extra": {
"enable_base64_output": False,
"enable_sync_mode": False
},
"campaign": "gpt_image_2_edit"
}
SPEC["css"] = Path(__file__).with_name("style.css").read_text(encoding="utf-8")
if __name__ == "__main__":
spaceui.launch(spaceui.build(SPEC), SPEC["css"])