mrhan1993 / Fooocus-API

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

Is it possible to return the image of the Running process in real time? #51

Closed Kimdow220807 closed 10 months ago

Kimdow220807 commented 10 months ago

Is it possible to return the image of the Running process in real time?

ImmNaruto commented 10 months ago

You can consider taking a look at the PNG image stream of the streaming output in api_utils.py/generation_output

Kimdow220807 commented 10 months ago

You can consider taking a look at the PNG image stream of the streaming output in api_utils.py/generation_output

Can you be more specific?

ImmNaruto commented 10 months ago

@Kimdow220807 You can enable the debug mode of your browser to see the streaming response of Fooocus on the web. It uses the image/png stream format. In the Fooocus API, this functionality is implemented in the function generation_output in api_utils.py. It checks for if streaming_output to determine whether to return the byte stream of the image.

ImmNaruto commented 10 months ago

@Kimdow220807 just like this. 微信截图_20231113115253

Kimdow220807 commented 10 months ago

@Kimdow220807 just like this. 微信截图_20231113115253

B17FB6A9-1858-44cb-B98F-C2F98E474FFB 请问是这样吗?(query)这个参数去哪里找?

ImmNaruto commented 10 months ago

@Kimdow220807 accept里填写image/png,请求的那两个参数一个是在最后结果中返回base64,一个是异步获取job id,都和这个图片流没太大关系。你需要在页面前端指定这个接口链接,像这样: 微信截图_20231114102355

konieshadow commented 10 months ago

@Kimdow220807 It is posible. I may add it in Query Job api in next version.

konieshadow commented 10 months ago

Guys. Version v0.3.14 can use the Query Job api to obtain the preview image and execution progress at current time. If you want preview image, just pass true as require_step_preivew param.

It's not as same as the WebSocket stream style api. If anyone has a better idea, please share.

Kimdow220807 commented 10 months ago

@Kimdow220807 accept里填写image/png,请求的那两个参数一个是在最后结果中返回base64,一个是异步获取job id,都和这个图片流没太大关系。你需要在页面前端指定这个接口链接,像这样: 微信截图_20231114102355

謝謝

Kimdow220807 commented 10 months ago

Guys. Version v0.3.14 can use the Query Job api to obtain the preview image and execution progress at current current. If you want preview image, just pass true as require_step_preivew param.

It's not as same as the WebSocket stream style api. If anyone has a better idea, please share.

Thank you. Yes.