mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
585 stars 156 forks source link

Custom Host parameter to use in webhook URL response #360

Closed kawikao closed 4 months ago

kawikao commented 5 months ago

I set the --host 0.0.0.0 to expose the API outside my machine. The image URL uses 127.0.0.1.

I want a custom "hostname" parameter so I can recall images from outside a firewall using custom DNS.

{'job_id': '18618c56-b522-4aed-baac-91d544ca02e7', 'job_result': [{'url': 'http://127.0.0.1:8888/files/2024-06-18/18618c56-b522-4aed-baac-91d544ca02e7-0.png', 'seed': '8711986227374106383'}]}

would be something like

result = text2img({
    "hostname": "custom-host.com",
    ...
}

{'job_id': '18618c56-b522-4aed-baac-91d544ca02e7', 'job_result': [{'url': 'http://custom-host.com:8888/files/2024-06-18/18618c56-b522-4aed-baac-91d544ca02e7-0.png', 'seed': '8711986227374106383'}]}

I can probably figure it out but just checking if it's on the roadmap?

Cheers

mrhan1993 commented 5 months ago

try --base-url

kickin6 commented 5 months ago

Works, thanks!