Skip to content

fix: default server_name to 127.0.0.1 and add show_error to launch() - #4186

Open
rioayumi wants to merge 1 commit into
lllyasviel:mainfrom
rioayumi:main
Open

fix: default server_name to 127.0.0.1 and add show_error to launch()#4186
rioayumi wants to merge 1 commit into
lllyasviel:mainfrom
rioayumi:main

Conversation

@rioayumi

@rioayumi rioayumi commented Jun 6, 2026

Copy link
Copy Markdown

Summary

  • When --listen is not specified, server_name was passed as None to gradio_root.launch(), causing Gradio to raise "When localhost is not accessible, a shareable link must be created" on some macOS environments with restrictive network/proxy settings.
  • Default server_name to "127.0.0.1" when args.listen is falsy, so the server always binds to loopback when no explicit listen address is provided.
  • Add show_error=True to surface Gradio-level errors in the browser UI instead of silently failing.

Test plan

  • Launch Fooocus without --listen flag on macOS — UI should open at http://127.0.0.1:7865
  • Launch with --listen 0.0.0.0 — existing behaviour unchanged
  • Confirm error messages appear in the UI when Gradio encounters an issue

🤖 Generated with Claude Code

When --listen is not specified, server_name was passed as None, which
causes Gradio to fail with "When localhost is not accessible, a shareable
link must be created" on some macOS / proxy configurations.

Defaulting to "127.0.0.1" ensures the server always binds to loopback
when no explicit listen address is provided. Also adds show_error=True
to surface Gradio-level errors in the UI rather than silently failing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rioayumi
rioayumi requested a review from lllyasviel as a code owner June 6, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant