benrugg / AI-Render

Stable Diffusion in Blender
MIT License
1.1k stars 85 forks source link

Not receiving image when running Automatic1111 on a Runpod Jupyter notebook #122

Open dmitrybaltin opened 1 year ago

dmitrybaltin commented 1 year ago

Describe the bug

I try to use AI-render addon together with Automatic1111 deployed in RunPod service using jupyter notebook fast-stable-diffusion It's the way recomended by Runpod

The connection is established and the request is successull sent but there is an exception occurses in the file automatic1111_api.py in the following string of handle_success() function:

response_obj = response.json()

All the code before the wrong string are executed correctly including the checking the status in the string

if response.status_code == 200:

Also I see in the jupyter notebook with SD that the SD works and generates the picture.

I dumped the response.content object to the file. It looks like a binary data and I can't understand it's format by visual seeing. The size of file is ~350-400 kb and it 's similar the png or jpg file of the size 512x768 witch I try to generate. I attached it here. (I packed it to zip because github don't want to download the file of unknown format)

It's the first time when I see the 'requests' library so I can suppose two reasons of the bug (Maybe my supposings is wrong):

  1. The reult is in binary format but not is a text as the AI Renderer addon expects.
  2. The result is encrypted (but in this case it's strange that the automatic successfully get the input data)

In the both cases I don't know what to do and how to fix it. Maybe there ara any setting of output data in automatic1111 but I can't find it.

dump.zip

To reproduce

The bug is 100% reproducible

  1. Start Automatic1111 on Runpod
  2. Launch Blender, open the blend file, switch to render mode.
  3. Setup the settings of AI Renderer Addon inpreference: choose local automatic1111, enter the URL witch is always new after ralaunching Automatic, usially it looks like https://rhft3k44x3eun0-3001.proxy.runpod.net/, port is not required (i tryed to set the port 7860 but it does not work)
  4. Press F12 to render and whait several seconds

Error log

BlenderConsoleLog.txt

Environment

Screenshots/video

No response

Additional information

response.headers = {'Date': 'Tue, 11 Jul 2023 15:10:09 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains', 'Vary': 'Accept-Encoding', 'X-Process-Time': '2.4444', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=MepGM3D0P8UrB5ClIHa5PtTKrspdE2l6mjUdTFB2WK9dh4b9Qs7nfWyRZo%2B8QK5LPH8GovJbqX3jY5n55K9oZVW2tzIossKLjg9V%2FPLtMrVktyEwg%2FXp42yvAAtE620Sgz%2B1myKGXsa56qJPL3p89wZWlKprTQ%3D%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}', 'Set-Cookie': '__cflb=02DiuFoofD6fhPpBaAsUWRBsQ3ZkHnhQtascZteRZZ1rk; SameSite=None; Secure; path=/; expires=Wed, 12-Jul-23 14:10:09 GMT; HttpOnly', 'Server': 'cloudflare', 'CF-RAY': '7e51f8a8f886c31e-VIE', 'Content-Encoding': 'br'}

benrugg commented 1 year ago

Ah, interesting. I don't think I've seen anyone successfully use AI Render with Automatic1111 running on a notebook. (Or if they have, I haven't heard about it).

I will look into this, but it might be a while before I can get to it!

dmitrybaltin commented 1 year ago

May be may way is wrong. Really it's a little strange that this run pod environment deploys Jupyter and then jupiter deploys automatic 1111)

Maybe somebody can show me simple and correct way how to deploy automatic 1111 to server in Internet.

I like to use remote servers and cloud services for heavy tasks because it's the way for me to work anywhere using light laptop. And it's cheap way - I usually spend not more 10-20$ for different services. So I can't and I don't plan to deploy SD to my own computer.

Earlier I use Colab for running SD, but some month ago Google broken it, so I found the method using Run pod. It's not free but not expensive, and also it's simple, stable and predictable. And it's cheaper then Dream Studio and I can customise it using automatic 1111.

benrugg commented 1 year ago

Yeah, it's a really convenient and inexpensive way to do it, for sure! For what it's worth, you can still do it on the Google Colab notebooks for about the same price you mentioned. (But I'm not sure if anyone has gotten AI Render working with that, either)

benrugg commented 1 year ago

Here is a place with instructions and a colab notebook to clone: https://andrewongai.gumroad.com/l/stable_diffusion_quick_start?layout=profile&recommended_by=library

(again, not sure if this will work with AI Render, but I just wanted to at least throw it out there!)

dmitrybaltin commented 1 year ago

The free Collab account is not working at the moment. It seems to work, but it doesn't actually work) because every 5-10 minutes (maybe 2-3 mitutes) Colab displays a message a kind of "Are you still here? Press the button". That's very annoying and of course it's impossible to switch to colab page every several minutes to close this message when you working with SD. Maybe even (i'm not sure) somtimes it requests Captcha. Google writes that Colab is "only for interactive work but not for deploying servers" that's why they added this protection.

As for the paid account. I haven't tried it, but I've read bad reviews. They say it's not cheap because Google counts certain "computing units". When I use Runpad, I can choose the configuration and pay for the time spent. But Google calculates "units", and as I read in the reviews, 100 units by default is really an insignificant amount, and it can be spent in an hour. Although I haven't actually tried it myself)

benrugg commented 1 year ago

Gotcha. Ok, that's good to know!