TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.48k stars 1.3k forks source link

No link on google colab automatic 1111 #2227

Open Mandais opened 1 year ago

Mandais commented 1 year ago

Hello,

I have a little issue with automatic 1111 on google colab. When I have launch it, this afternoon, the webui have instantly lost connection, then the google colab don't give me the link for the webui. I just have try again and this time it don't give me like. So I have try to remove the old files and reinstall it but the issue seems to persist without the case Use_Latest_Working_Commit

When I launch it with Use_Latest_Working_Commit i get this

Error loading script: api.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/api.py", line 9, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Error loading script: batch_hijack.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 7, in from scripts import external_code File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Error loading script: controlnet.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 12, in from scripts import global_state, hook, external_code, processor, batch_hijack, controlnet_version, utils File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

ControlNet v1.1.210 Error loading script: external_code.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Calculating sha256 for /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/model.ckpt: 4c86efd062ea772972dd068c3870773f1fd9a37ba9a288ee79ec848448ce7785 Loading weights [4c86efd062] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/model.ckpt Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Downloading (…)olve/main/vocab.json100% 961k/961k [00:00<00:00, 11.5MB/s] Downloading (…)olve/main/merges.txt100% 525k/525k [00:00<00:00, 26.4MB/s] Downloading (…)cial_tokens_map.json100% 389/389 [00:00<00:00, 2.40MB/s] Downloading (…)okenizer_config.json100% 905/905 [00:00<00:00, 4.15MB/s] Downloading (…)lve/main/config.json100% 4.52k/4.52k [00:00<00:00, 26.9MB/s] Applying scaled dot product cross attention optimization. Textual inversion embeddings loaded(0): Model loaded in 34.0s (calculate hash: 13.4s, load weights from disk: 11.8s, create model: 2.5s, apply weights to model: 4.1s, apply half(): 1.2s, move model to device: 0.9s). Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 337, in webui() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 240, in webui shared.demo = modules.ui.create_ui();shared.demo.queue(concurrency_count=999999,status_update_rate=0.1) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 461, in create_ui txt2img_prompt, txt2img_prompt_styles, txt2img_negativeprompt, submit, , _, txt2img_prompt_style_apply, txt2img_save_style, txt2img_paste, extra_networks_button, token_counter, token_button, negative_token_counter, negative_token_button = create_toprow(is_img2img=False) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 284, in create_toprow with gr.Row(elem_id=f"{id_part}_toprow", variant="compact"): File "/usr/local/lib/python3.10/dist-packages/gradio/layouts.py", line 43, in init super().init(visible=visible, elem_id=elem_id, kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 274, in init super().init(visible=visible, render=render, kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 79, in init self.render() File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 94, in render if isinstance(self, components.TempFileManager): AttributeError: module 'gradio.components' has no attribute 'TempFileManager'

Any idea? (by the way I'm on a colab pro)

(By the way, thanks you a lot for all the work you are doing on this colab, it's just wonderful)

nikjir commented 1 year ago

hello! it seems like i am having the same problem on a clean install:

@markdown # Start Stable-Diffusion

from IPython.utils import capture import time import sys import fileinput from pyngrok import ngrok, conf

Use_Cloudflare_Tunnel = False #@param {type:"boolean"}

@markdown - Offers better gradio responsivity

Ngrok_token = "" #@param {type:"string"}

@markdown - Input your ngrok token if you want to use ngrok server

User = "" #@param {type:"string"} Password= "" #@param {type:"string"}

@markdown - Add credentials to your Gradio interface (optional)

auth=f"--gradio-auth {User}:{Password}" if User =="" or Password=="": auth=""

with capture.capture_output() as cap: %cd /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/modules/

if Use_Latest_Working_Commit: !wget -q -O paths.py https://github.com/TheLastBen/fast-stable-diffusion/raw/5632d2ef7fffd940976538d270854ec4faf26855/AUTOMATIC1111_files/paths.py !wget -q -O extras.py https://github.com/AUTOMATIC1111/stable-diffusion-$blasphemy/raw/a9eab236d7e8afa4d6205127904a385b2c43bb24/modules/extras.py !wget -q -O sd_models.py https://github.com/AUTOMATIC1111/stable-diffusion-$blasphemy/raw/a9eab236d7e8afa4d6205127904a385b2c43bb24/modules/sd_models.py !wget -q -O /usr/local/lib/python3.10/dist-packages/gradio/blocks.py https://github.com/TheLastBen/fast-stable-diffusion/raw/7ff88eaa1fb4997bacd9845bd487f9a14335d625/AUTOMATIC1111_files/blocks.py else: !wget -q -O paths.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/AUTOMATIC1111_files/paths.py !wget -q -O extras.py https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-$blasphemy/master/modules/extras.py !wget -q -O sd_models.py https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-$blasphemy/master/modules/sd_models.py !wget -q -O /usr/local/lib/python3.10/dist-packages/gradio/blocks.py https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/AUTOMATIC1111_files/blocks.py %cd /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/

!sed -i "s@os.path.splitext(checkpoint_file)@os.path.splitext(checkpoint_file); map_location='cuda'@" /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/modules/sd_models.py !sed -i 's@ui.create_ui().@ui.create_ui();shared.demo.queue(concurrency_count=999999,status_update_rate=0.1)@' /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/webui.py !sed -i "s@map_location='cpu'@map_location='cuda'@" /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/modules/extras.py !sed -i 's@/content/gdrive/MyDrive/sd/stablediffusion@/content/gdrive/{mainpth}/sd/stablediffusion@' /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/modules/paths.py !sed -i 's@print(\"No module.@@' /content/gdrive/$mainpth/sd/stablediffusion/ldm/modules/diffusionmodules/model.py !sed -i 's@\"quicksettings\": OptionInfo(.*@"quicksettings": OptionInfo("sd_model_checkpoint, sd_vae, CLIP_stop_at_last_layers, inpainting_mask_weight, initial_noise_multiplier", "Quicksettings list"),@' /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/modules/shared.py

share='' if Ngrok_token!="": ngrok.kill() srv=ngrok.connect(7860, pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token) , bind_tls=True).public_url

for line in fileinput.input('/usr/local/lib/python3.10/dist-packages/gradio/blocks.py', inplace=True): if line.strip().startswith('self.server_name ='): line = f' self.server_name = "{srv[8:]}"\n' if line.strip().startswith('self.protocol = "https"'): line = ' self.protocol = "https"\n' if line.strip().startswith('if self.local_url.startswith("https") or self.is_colab'): line = '' if line.strip().startswith('else "http"'): line = '' sys.stdout.write(line)

elif Use_Cloudflare_Tunnel: with capture.capture_output() as cap: !pkill cloudflared time.sleep(4) !nohup cloudflared tunnel --url http://localhost:7860 > /content/srv.txt 2>&1 & time.sleep(4) !grep -o 'https[^[:space:]]*.trycloudflare.com' /content/srv.txt >/content/srvr.txt time.sleep(2) srv= getoutput('cat /content/srvr.txt')

for line in fileinput.input('/usr/local/lib/python3.10/dist-packages/gradio/blocks.py', inplace=True):
  if line.strip().startswith('self.server_name ='):
      line = f'            self.server_name = "{srv[8:]}"\n'
  if line.strip().startswith('self.protocol = "https"'):
      line = '            self.protocol = "https"\n'
  if line.strip().startswith('if self.local_url.startswith("https") or self.is_colab'):
      line = ''
  if line.strip().startswith('else "http"'):
      line = ''
  sys.stdout.write(line)

!rm /content/srv.txt /content/srvr.txt

else: share='--share'

try: model if os.path.isfile(model): !python /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt "$model" --opt-sdp-attention $auth --disable-console-progressbars else: !python /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt-dir "$model" --opt-sdp-attention $auth --disable-console-progressbars except: !python /content/gdrive/$mainpth/sd/stable-diffusion-$blasphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --opt-sdp-attention $auth --disable-console-progressbars

im also on colab pro, btw :)

not actually the same error, but starts the same. what could it be? ive tried reinstalling the whole thing a couple times now.

Mandais commented 1 year ago

I don't the source of the error but without Use_Latest_Working_Commit it seems to work at the fifth update, so maybe the link issue had been solve by itself ^^"

bronauti commented 1 year ago

This problem is old, it has been going on for about two months. It's practically like using an outdated version to use fast_stable_diffusion_AUTOMATIC1111.ipynb in Colab Pro. Last time, I also asked through this medium if there was a solution, but unfortunately, they couldn't give me a working answer. I need to use the option of inpainting conditioning mask strength, but it doesn't appear because if I click on the option "Use_Latest_Working_Commit," the link to use stable_diffusion doesn't appear, and errors show up.

TheLastBen commented 1 year ago

@bronauti are you using this link ? https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb

bronauti commented 1 year ago

@bronautiestas Yes, I always make sure to use the most updated link to see if the problem has been solved, but as I mentioned before, it has been like this for 2 months now. Perhaps people don't talk about it much because they don't want to be insistent, or maybe because the majority are no longer using Colab Pro since the problem has persisted for a long time. But in the end, the problem has always been about being able to use the latest updated version because when I check this box (Use_Latest_Working_Commit) in the cell (Install/Update AUTOMATIC1111 repo), it always throws an error in the cell (Start Stable-Diffusion) that prevents me from obtaining the access link.

Start Stable-Diffusion Error loading script: api.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/api.py", line 9, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Error loading script: batch_hijack.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 7, in from scripts import external_code File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Error loading script: controlnet.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 12, in from scripts import global_state, hook, external_code, processor, batch_hijack, controlnet_version, utils File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

ControlNet v1.1.214 Error loading script: external_code.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/external_code.py", line 8, in from modules.api import api File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/api/api.py", line 8, in from gradio.processing_utils import decode_base64_to_file ImportError: cannot import name 'decode_base64_to_file' from 'gradio.processing_utils' (/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py)

Calculating sha256 for /content/model.safetensors: c914949b9834e9b99a99d5f3a60fb0dc96e84458236922f874c0615286017bf1 Loading weights [c914949b98] from /content/model.safetensors Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Downloading (…)olve/main/vocab.json100% 961k/961k [00:00<00:00, 12.4MB/s] Downloading (…)olve/main/merges.txt100% 525k/525k [00:00<00:00, 7.23MB/s] Downloading (…)cial_tokens_map.json100% 389/389 [00:00<00:00, 3.04MB/s] Downloading (…)okenizer_config.json100% 905/905 [00:00<00:00, 5.15MB/s] Downloading (…)lve/main/config.json100% 4.52k/4.52k [00:00<00:00, 30.1MB/s] Applying scaled dot product cross attention optimization. Textual inversion embeddings loaded(0): Model loaded in 25.1s (calculate hash: 10.2s, load weights from disk: 8.2s, create model: 1.9s, apply weights to model: 2.8s, apply half(): 1.1s, move model to device: 0.8s). Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 337, in webui() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 240, in webui shared.demo = modules.ui.create_ui();shared.demo.queue(concurrency_count=999999,status_update_rate=0.1) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 461, in create_ui txt2img_prompt, txt2img_prompt_styles, txt2img_negativeprompt, submit, , _, txt2img_prompt_style_apply, txt2img_save_style, txt2img_paste, extra_networks_button, token_counter, token_button, negative_token_counter, negative_token_button = create_toprow(is_img2img=False) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 284, in create_toprow with gr.Row(elem_id=f"{id_part}_toprow", variant="compact"): File "/usr/local/lib/python3.10/dist-packages/gradio/layouts.py", line 43, in init super().init(visible=visible, elem_id=elem_id, kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 274, in init super().init(visible=visible, render=render, kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 79, in init self.render() File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 94, in render if isinstance(self, components.TempFileManager): AttributeError: module 'gradio.components' has no attribute 'TempFileManager'

Obviously, the solution to this problem is not selecting the checkbox (Use_Latest_Working_Commit). However, if you do it this way, you won't be able to use an updated version of fast_stable_diffusion_AUTOMATIC1111 with all the functions that have been added recently during this year.

TheLastBen commented 1 year ago

@bronauti it's actually the opposite, untick that box to use the updated version