fix: migrate to Gradio 6.0 launch() API for css and title
In Gradio 6.0, css, title, and theme parameters moved from gr.Blocks() constructor to the .launch() method. Updated app.py accordingly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -30,13 +30,9 @@ def get_gpu_status() -> str:
|
|||||||
|
|
||||||
def create_app() -> gr.Blocks:
|
def create_app() -> gr.Blocks:
|
||||||
"""Create and return the main Gradio application."""
|
"""Create and return the main Gradio application."""
|
||||||
css = get_css()
|
|
||||||
|
|
||||||
# Gradio 6.0+ compatible Blocks initialization
|
# Gradio 6.0+ compatible Blocks initialization
|
||||||
with gr.Blocks(
|
# Note: css and title moved to launch() per Gradio 6.0 API
|
||||||
css=css,
|
with gr.Blocks() as app:
|
||||||
title="Real-ESRGAN Upscaler",
|
|
||||||
) as app:
|
|
||||||
# Header
|
# Header
|
||||||
gr.HTML(
|
gr.HTML(
|
||||||
"""
|
"""
|
||||||
@@ -91,6 +87,9 @@ def launch_app():
|
|||||||
logger.info("Starting Real-ESRGAN Web UI...")
|
logger.info("Starting Real-ESRGAN Web UI...")
|
||||||
logger.info(get_gpu_status())
|
logger.info(get_gpu_status())
|
||||||
|
|
||||||
|
# Get CSS for launch
|
||||||
|
css = get_css()
|
||||||
|
|
||||||
# Create and launch app
|
# Create and launch app
|
||||||
app = create_app()
|
app = create_app()
|
||||||
|
|
||||||
@@ -100,10 +99,12 @@ def launch_app():
|
|||||||
max_size=config.max_queue_size,
|
max_size=config.max_queue_size,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Launch server
|
# Launch server (Gradio 6.0: css and title go here)
|
||||||
app.launch(
|
app.launch(
|
||||||
server_name=config.server_name,
|
server_name=config.server_name,
|
||||||
server_port=config.server_port,
|
server_port=config.server_port,
|
||||||
share=config.share,
|
share=config.share,
|
||||||
show_error=True,
|
show_error=True,
|
||||||
|
css=css,
|
||||||
|
app_kwargs={"title": "Real-ESRGAN Upscaler"},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user