Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨 Why is Colab Disconnecting? #405

Open
camenduru opened this issue May 4, 2023 · 46 comments
Open

🚨 Why is Colab Disconnecting? #405

camenduru opened this issue May 4, 2023 · 46 comments

Comments

@camenduru
Copy link
Owner

According to the official statement, the Colab Free tier is not available for the Stable Diffusion WebUI 😭. We can only use it with a paid plan.

If you have more questions, please ask here: https://github.com/googlecolab/colabtools/issues

@1Zero11
Copy link

1Zero11 commented May 4, 2023

Yeah... seems like they've started to enforce it

@zaviier
Copy link

zaviier commented May 4, 2023

some Colab still can use it.. just remove/rename stable-diffusion thing to another name. and it's solved

@romper-pain
Copy link

are there any sort of workarounds for this? renaming the project, having an alternate disguised version, or any free colab alternatives or whatnot?

@etherealxx
Copy link
Collaborator

some Colab still can use it.. just remove/rename stable-diffusion thing to another name. and it's solved

camenduru can't just do that, i think. All eyes are on his colab. Colab team can figure out the better solution to even banning more strictly. At this point just be chill with the 'safe' colab.

@etherealxx
Copy link
Collaborator

are there any sort of workarounds for this? renaming the project, having an alternate disguised version, or any free colab alternatives or whatnot?

There are many that claims 'still safe', check out here: https://github.com/camenduru/stable-diffusion-webui-colab/tree/community

@Rush-gif
Copy link

Rush-gif commented May 5, 2023

some Colab still can use it.. just remove/rename stable-diffusion thing to another name. and it's solved

But how to do that from where to remove it

@Rush-gif
Copy link

Rush-gif commented May 5, 2023

#407
What about this thing

@mike59881051
Copy link

Is it just webUI is banned or stable diffusion altogether?

@mcube-12139
Copy link

Rename "stable diffusion" to "erratic condensation"

@bincooo
Copy link

bincooo commented May 24, 2023

Step1
Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw
Replace all webui characters with $w

@gabrielsmecrow
Copy link

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

works for me

@tralala87
Copy link

tralala87 commented May 31, 2023

It doesn't work for me:

`Status Legend:
(OK):download completed.
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--continue'.
-> [OptionHandlerImpl.cc:95] errorCode=1 continue must be either 'true' or 'false'.
Usage:
-c, --continue[=true|false] Continue downloading a partially downloaded
file. Use this option to resume a download
started by a web browser or another program
which downloads files sequentially from the
beginning. Currently this option is only
applicable to http(s)/ftp downloads.

                          Possible Values: true, false
                          Default: false
                          Tags: #basic, #http, #ftp

sed: can't read /content//launch.pyi: No such file or directory
sed: can't read /content//launch.py: No such file or directory
sed: can't read /content//modules/shared.py: No such file or directory
python3: can't open file '/content/stable-diffusion-webui/launch.py': [Errno 2] No such file or directory`

@SEYED1424
Copy link

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

wich stable-diffusion-webui? because some of them are related to web URLs and others are related to local directories.

@vicentefelipechile
Copy link

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

What header?

@DeekshithSH
Copy link

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

why encoding and decoding
when it can be done something like this
https://github.com/DeekshithSH/Automatic-1111-WebUI-Colab/blob/main/controlnet.ipynb

@bincooo
Copy link

bincooo commented Jul 2, 2023

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2
Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

why encoding and decoding when it can be done something like this https://github.com/DeekshithSH/Automatic-1111-WebUI-Colab/blob/main/controlnet.ipynb

ofcourse, as long as you achieve the purpose of blocking keywords

@Sarthak-999
Copy link

Hi there,I am not a coder but need to use stable diffusion for free if possible can anyone please figure out about this

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2

Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

I understood the second step that by going on edit we can replace it but can anyone please tell me about how to do the first step it would be really helpful for me,thank you for reading.

@DeekshithSH
Copy link

DeekshithSH commented Jul 31, 2023

Just paste the code

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

In top of the code

@Sarthak-999
Copy link

Do we have to make a new cell or on the top of first cell?,thank you soo much for replying.

@DeekshithSH
Copy link

DeekshithSH commented Jul 31, 2023

Do we have to make a new cell or on the top of first cell?,thank you soo much for replying.

On top of existing cell(first cell)

@timtensor
Copy link

Hi , can you share the colab notebook or snippet where you actually make the changes ? That would be of great help

@DeekshithSH
Copy link

Hi , can you share the colab notebook or snippet where you actually make the changes ? That would be of great help

Here is a modified notebook files
This and This
Don't know this still works or not
You can reference this file but it's little bit different than what trick your trying to ask

@LIMPIX31
Copy link

LIMPIX31 commented Aug 4, 2023

@DeekshithSH

Thank you! That's working fine!

While I still have issues with the SD itself, they are not colab related and are easy to fix.

If you load your model, remember to also replace all occurrences of stable as well

@omensight
Copy link

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2
Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

works for me

This is joy, will try it after work, Love this project. Thank you so much.

@zaviier
Copy link

zaviier commented Sep 10, 2023

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2
Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

works for me

This is joy, will try it after work, Love this project. Thank you so much.

is this still worked?

@loboere
Copy link

loboere commented Sep 11, 2023

@bincooo Can you make a colab that has this code in the right place, I don't know where to put it.

@zaviier
Copy link

zaviier commented Sep 13, 2023

@bincooo Can you make a colab that has this code in the right place, I don't know where to put it.

this does not work anymore. I already tested

@SixSiege
Copy link

SixSiege commented Sep 17, 2023

Alright, so apparently "diffusion" is the new blocked word. I tried changing "diffusion" to {d} and adding d="diffusion" on top of the cell and it works

@SysGang
Copy link

SysGang commented Sep 17, 2023

Alright, so apparently "diffusion" is the new blocked word. I tried changing "diffusion" to {d} and adding d="diffusion" on top of the cell and it works

How can I implement this? Can you give maybe a step-by-step tutorial? Thanks.

@zaviier
Copy link

zaviier commented Sep 18, 2023

Alright, so apparently "diffusion" is the new blocked word. I tried changing "diffusion" to {d} and adding d="diffusion" on top of the cell and it works

nope. still disconnected

@possom2009
Copy link

possom2009 commented Sep 18, 2023

Is there a version without webui? That's what's banned, a non webui version should work ok.

@upright2003
Copy link

I can test diffusion that day, but it won’t work tomorrow.
Is there a way to generate an image using the following command??

python scripts/txt2img.py --prompt "YOUR-PROMPT-HERE" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1

https://www.assemblyai.com/blog/how-to-run-stable-diffusion-locally-to-generate-images/

@kawasaki-koto
Copy link

I made a copy of it in a private git repository and removed "webui" and used it.
It worked fine for the last few days, but now it doesn't work.
It is very likely that colab has set up a ban word other than "webui".

@Vector-Stack
Copy link

it's the problem of "diffusion".

@gustavokch
Copy link

gustavokch commented Sep 29, 2023

Step1 Append code in header:

import sys
import os
import base64

w = base64.b64decode(("d2VidWk=").encode('ascii')).decode('ascii')
sdw = base64.b64decode(("c3RhYmxlLWRpZmZ1c2lvbi13ZWJ1aQ==").encode('ascii')).decode('ascii')

Step2
Replace all stable-diffusion-webui characters with $sdw Replace all webui characters with $w

works for me

This is joy, will try it after work, Love this project. Thank you so much.

is this still worked?

New step 1 trick:

add the following to first cell

!pip install pycryptodome pycryptodomex
import sys
import os

from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes


key = b'\x7f\xb0\xe2\xd6\xdf\xad\xc5S\x1f\x1b\x141\x9f\x1b\x08\x99'
nonce = b'(\xfd\xfd\xc4\x04\xff\x9d\xc5\xe6\xc8.\x8b\xaf>\xb4\xe6'
tag = b'\x11\xd6`\xf77\xeb\x1dq\xb9\x19l,\x83\x08,\xb1'
ciphertext = b'\xcc\xbeb\x0bH'
cipher = AES.new(key, AES.MODE_EAX, nonce)
data = cipher.decrypt_and_verify(ciphertext, tag)

data = str(data)
data = data.replace("b'", "")
data = data.replace("'", "")
print(data)
w = data

key = b'\xdeO\xbd\xa7G\xda\x85b\xba\x15f6\x8b\xc5\xc8\x17'
nonce = b'j\x1d]\xf4\xc2\x91\xed\xc4\x96=\xb2C\xe5\xf3\xaa2'
tag = b'\xc3\xce\xd2M\x1b\x19\xed\xee\xc1\x94?01O\nX'
ciphertext = b'\x86\x89\xbd3P8\xc4\xccA\xdeQ*\x10k0\xe1\xb2<T\xed\x95\xf3'


cipher = AES.new(key, AES.MODE_EAX, nonce)
data2 = cipher.decrypt_and_verify(ciphertext, tag)

data2 = str(data2)
data2 = data2.replace("b'", "")
data2 = data2.replace("'", "")
print(data2)
sdw = data2

@gustavokch
Copy link

gustavokch commented Sep 30, 2023

here is a working notebook file
wui.zip
EDIT: sometimes it disconnects...

@gustavokch
Copy link

gustavokch commented Sep 30, 2023

My working notebook that supports model loading from huggingface or civitai, loras, long prompts and (IMO) the best upscaling algorithms, without web UI.

If you want to use a GDrive that is not the same as the account logged in on colab, setup rclone and select that option
sd_gpu_upscaling.zip

@gustavokch
Copy link

gustavokch commented Sep 30, 2023

ALSO, this GUI works fine on colab free, even though for some reason the results are kind of lo-fi: https://github.com/camenduru/InvokeAI-colab/blob/main/InvokeAI_colab.ipynb

another option using TPU instances for crazy fast inference:
stable_diffusion_jax_clean.zip

@upright2003
Copy link

upright2003 commented Oct 1, 2023

ALSO, this GUI works fine on colab free, even though for some reason the results are kind of lo-fi: https://github.com/camenduru/InvokeAI-colab/blob/main/InvokeAI_colab.ipynb

another option using TPU instances for crazy fast inference: stable_diffusion_jax_clean.zip

stable_diffusion_jax_clean.zip stable_diffusion_jax_clean.ipynb This ipynb file cannot be opened, there is an error

@gustavokch
Copy link

gustavokch commented Oct 2, 2023

Please speak english if you wan't help, use a translator if you need one. What error are you getting?

Set runtime to TPU.

Make sure to use native Gdrive if you don't have rclone setup, and fill in the huggingface token. The rclone option is only there in case you want to use Google Drive from another account.

Otherwise, just read the code and the error message, read the documentation on hugging face hub and try to fix it.

@upright2003
Copy link

Please speak english if you wan't help, use a translator if you need one. What error are you getting?

Set runtime to TPU.

Make sure to use native Gdrive if you don't have rclone setup, and fill in the huggingface token. The rclone option is only there in case you want to use Google Drive from another account.

Otherwise, just read the code and the error message, read the documentation on hugging face hub and try to fix it.

I am sorry.
stable_diffusion_jax_clean.zip stable_diffusion_jax_clean.ipynb This ipynb file cannot be opened, there is an error
https://i.imgur.com/9mlbTLu.png
Notebook loading error
The file is corrupted or is not a valid notebook file.

@ParikhKadam
Copy link

Let's shift this chat to a discord / telegram. Google might be spying on us -_-

@gustavokch
Copy link

gustavokch commented Oct 3, 2023

ALSO, this GUI works fine on colab free, even though for some reason the results are kind of lo-fi: https://github.com/camenduru/InvokeAI-colab/blob/main/InvokeAI_colab.ipynb
another option using TPU insta
stable_diffusion_jax_clean_fix.zip
nces for crazy fast inference: stable_diffusion_jax_clean.zip

stable_diffusion_jax_clean.zip stable_diffusion_jax_clean.ipynb This ipynb file cannot be opened, there is an error

My bad... Here is the fix.
stable_diffusion_jax_clean_fix.zip

@gustavokch
Copy link

Let's shift this chat to a discord / telegram. Google might be spying on us -_-

OK... DM me with details.

The way I see it, Google is not against running stable diffusion itself, but rather the popular GUIs, and they're mostly enforcing it through string detection, or perhaps by dumping running processes and comparing to known hashes of files in such GUIs. Nor diffusion, diffusers, neither stable-diffusion, gradio or stablediffusion are specifically banned strings.

For banned strings you can always encrypt them using something like AES with random keys, the problem with running the full stable-diffusion-webui is most likely the strings inside the repo files which there is no way to replace statically without breaking the code somewhere else.

I haven't really dug into this much, but if there way some way to trace the execution while printing the last line executed by the interpreter, it would be possible to circumvent the restriction, but it won't be an easy task. Maybe using cython or numba jit could work. Or writing a wrapper for the python executable in a more performant language that encrypts memory dynamically.

I'm not that crazy about using GUIs to consider such work atm, solutions can be made from scratch using native jupyter without ever needing to run a web server or code from banned popular implementations.

@ParikhKadam
Copy link

@gustavokch how do I reach out?

@DuckytheQuack
Copy link

DuckytheQuack commented Oct 11, 2023

@gustavokch @ParikhKadam I made a discord server where we can discuss it further. I also have some ideas for getting around the block.

Discord server invite base64: aHR0cHM6Ly9kaXNjb3JkLmdnL3NzYTVYRTVycg==

If you'd prefer it be a telegram just let me know

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

No branches or pull requests