Giter Club home page Giter Club logo

sd-webui-colab's Introduction

[Deprecated - this repo is not maintaned anymore as there are more up to date, faster and better Colabs out there]

Colab version of the amazing stable diffusion web ui repo located here

See the original repo for all the features

This repo is for the maintenance of the Colab script itself

Open In Colab

Super simple to get started

CleanShot 2022-08-28 at 21 40 05@2x

After it loads everything, it WILL fail and send you a notification, it's ok

  • Download the stable diffusion model (s-d-v1-4.ckpt) file from Hugging Face Stable Diffusion
  • Create a folder in the root of your Google Drive and name it AI
  • Upload the downloaded file into Ai/models (create the models folder)

Then click Runtime -> Run After It will ask you to connect your google drive to find the model.

CleanShot 2022-08-28 at 21 47 03@2x

The keep running the cells or again hit Runtime -> Run After

After all cells have run, time to launcht he webui!

CleanShot 2022-08-28 at 22 05 13@2x

TADA

CleanShot 2022-08-28 at 22 06 42@2x

sd-webui-colab's People

Contributors

acid1103 avatar altryne avatar pinilpypinilpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sd-webui-colab's Issues

[Bug]: Generation hangs forever when batch size > 1

What happened?

The timer keeps counting up forever, with the loading gif spinning. No errors. No image displayed.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

No response

Where are you running the webui?

No response

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Stuck when using batch size larger than 1

When the batch size is set to 2 or more, the web UI doesn't show the created images, continues "loading" them forever and doesn't react to inputting either new prompts or the same one.
The images still appear in the google drive folder after they're generated.

[Bug]: CondaEnvException: Pip failed

What happened?

A bug happened! what i do with this: "CondaEnvException: Pip failed"

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

No response

Where are you running the webui?

No response

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Username and Password

What happened?

What is the username and password to log into the gradio link given? Specifically the username. I put down my "shared password" but never a username.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Windows

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

(Img2Img) RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 3

Img2Img local:

File "scripts/webui.py", line 1194, in sample
    xi = x0 + noise
RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 3

Img2Img Colab:


Iteration: 1/1
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gradio/routes.py", line 247, in run_predict
    output = await app.blocks.process_api(
  File "/usr/local/lib/python3.8/site-packages/gradio/blocks.py", line 641, in process_api
    predictions, duration = await self.call_function(fn_index, processed_input)
  File "/usr/local/lib/python3.8/site-packages/gradio/blocks.py", line 556, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/usr/local/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/content/stable-diffusion/scripts/webui.py", line 1288, in img2img
    output_images, seed, info, stats = process_images(
  File "/content/stable-diffusion/scripts/webui.py", line 819, in process_images
    samples_ddim = func_sample(init_data=init_data, x=x, conditioning=c, unconditional_conditioning=uc, sampler_name=sampler_name)
  File "/content/stable-diffusion/scripts/webui.py", line 1194, in sample
    xi = x0 + noise
RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 3

[Bug]: No usable font found

What happened?

After entering prompt, got the following error:
Exception: No usable font found (tried arial.ttf, DejaVuSans.ttf)

SCR-20220903-dq7

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

Iteration: 1/1
100% 13/13 [00:04<00:00,  2.83it/s]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gradio/routes.py", line 247, in run_predict
    output = await app.blocks.process_api(
  File "/usr/local/lib/python3.8/site-packages/gradio/blocks.py", line 641, in process_api
    predictions, duration = await self.call_function(fn_index, processed_input)
  File "/usr/local/lib/python3.8/site-packages/gradio/blocks.py", line 556, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/usr/local/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "scripts/webui.py", line 998, in txt2img
    output_images, seed, info, stats = process_images(
  File "scripts/webui.py", line 923, in process_images
    grid = image_grid(output_images, batch_size)
  File "scripts/webui.py", line 419, in image_grid
    fnt = get_font(30)
  File "scripts/webui.py", line 401, in get_font
    raise Exception(f"No usable font found (tried {', '.join(fonts)})")
Exception: No usable font found (tried arial.ttf, DejaVuSans.ttf)

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Webui hangs after img2img

What happened?

Posting on the colab fork as I run the desktop version of the hlky webui without this issue -

The colab version hangs after running img2img processes that are batched over 1. Running 1 batch functions and intended. Anything over and the webui runs into an infinite loop, as if it isn't getting a callback from the server to let it know processing has finished. Only solution is to refresh the browser window which gets pretty tedious.

Wondering if there's a way to track down this issue or if it's some sort of limitation with Gradio.

Happy to help diagnose. :)

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Failed inference for GFPGAN

Failed inference for GFPGAN: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument weight in method wrapper___slow_conv2d_forward).

I'm having this message when I try to process the image with GFPGAN in the GFPGAN tab of the UI.

[suggestion] add download checkpoint instruction to the colab.

Thank you very much for the great colab. I am opening this issue because I went to the colab from twitter and could not figure out why the code is not running until I found this repository and understood the step of downloading the checkpoints is missing from the colab itself. Would you mind adding it to the colab?

tldr; add "download stable diffusion checkpoint and put it in AI folder" in the colab :)

Thanks.

[Bug]: ImportError: this version of pandas is incompatible with numpy < 1.20.3

What happened?

step3 - Launch WebUI for stable diffusion running wrong!
ImportError: this version of pandas is incompatible with numpy < 1.20.3

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

/content/stable-diffusion
Traceback (most recent call last):
  File "scripts/webui.py", line 3, in <module>
    from frontend.frontend import draw_gradio_ui
  File "/content/stable-diffusion/frontend/frontend.py", line 1, in <module>
    import gradio as gr
  File "/usr/local/lib/python3.8/site-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/usr/local/lib/python3.8/site-packages/gradio/components.py", line 33, in <module>
    import pandas as pd
  File "/usr/local/lib/python3.8/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev  # pyright: ignore # noqa:F401
  File "/usr/local/lib/python3.8/site-packages/pandas/compat/__init__.py", line 18, in <module>
    from pandas.compat.numpy import (
  File "/usr/local/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py", line 22, in <module>
    raise ImportError(
ImportError: this version of pandas is incompatible with numpy < 1.20.3
your numpy version is 1.19.2.
Please upgrade numpy to >= 1.20.3 to use this pandas version

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: colab not working

What happened?

EOFError: Ran out of input

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

/content/stable-diffusion
Loaded GFPGAN
Loaded RealESRGAN with model RealESRGAN_x4plus
Loading model from /content/drive/MyDrive/AI/models/sd-v1-4.ckpt
Traceback (most recent call last):
  File "/content/stable-diffusion/scripts/webui.py", line 337, in <module>
    sd = load_sd_from_config(opt.ckpt)
  File "/content/stable-diffusion/scripts/webui.py", line 148, in load_sd_from_config
    pl_sd = torch.load(ckpt, map_location="cpu")
  File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input

Code of Conduct

  • I agree to follow this project's Code of Conduct

Can't find model

So I've put the model file (sd-v1-4.ckpt) on my Google drive in AI/models:

Screen Shot 2022-08-31 at 15 11 21 PM

When it's running the 1.4 Connect to Google Drive step, it asks me for access, I give it permission, but then it fails:

Screen Shot 2022-08-31 at 15 16 35 PM

Results:

Local Path Variables:

/content
...error mounting drive or with drive path variables
...reverting to default path variables
models_path: /content/models
output_path: /content/output

I can't seem to find any other info on the error.

Any ideas?

Default UI settings state not loading from custom config file

Changing path to a custom config file on the drive is not loading the default UI settings.

e.g. defaults: "/content/drive/MyDrive/AI/configs/webui/webui.yaml"

It is fixed by adding --defaults '{defaults}' \ above the --share $vars.

e.g.

%cd /content/stable-diffusion
if share_password == "":
  !python /content/stable-diffusion/scripts/webui.py \
  --ckpt '{models_path}/sd-v1-4.ckpt' \
  --outdir '{output_path}' \
  --defaults '{defaults}' \
  --share $vars
else:
  !python /content/stable-diffusion/scripts/webui.py \
  --ckpt '{models_path}/sd-v1-4.ckpt' \
  --outdir '{output_path}' \
  --share-password '{share_password}' \
  --defaults '{defaults}' \
  --share $vars

[Bug]: Need to reload web UI for each new prompt/batch of images

What happened?

While using the public URL link generated, when I first generate a batch of images and it finishes, it displays them on that public URL page. Every subsequent batch doesn't display them. The number of seconds just keeps ticking up even when collab tells me it's done. Then I have to reload the public URL and re-enter my settings to run another prompt.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Firefox

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: SpecNotFound: Invalid name, try the format: user/package

What happened?

I unchecked stable-version so I can use the latest features of your awesome app. It was fine like 2-3 days ago. Now it throws me an error SpecNotFound: Invalid name, try the format: user/package in the Environment setup section.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

SpecNotFound: Invalid name, try the format: user/package

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: HELP! SpecNotFound: Invalid name, try the format: user/package

What happened?

I want use latest stable-diffusion version, but I get SpecNotFound: Invalid name, try the format: user/package
Running on colab.
Error at Environment setup section.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

SpecNotFound: Invalid name, try the format: user/package

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Model missing with error: "FileNotFoundError: [Errno 2] No such file or directory: '/content/sd-model/sd-v1-4.ckpt"

There seems to be an issues with acquiring the model, as it's not where the script expects it to be:

**Loading model from /content/sd-model/sd-v1-4.ckpt
Traceback (most recent call last):
File "/content/stable-diffusion/scripts/webui.py", line 451, in
model,modelCS,modelFS,device, config = load_SD_model()
File "/content/stable-diffusion/scripts/webui.py", line 399, in load_SD_model
sd = load_sd_from_config(opt.ckpt)
File "/content/stable-diffusion/scripts/webui.py", line 165, in load_sd_from_config
pl_sd = torch.load(ckpt, map_location="cpu")
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 699, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 212, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file There seems to be an issues with acquiring the model:

The output stops with the error above.

It might be connected to this output that appears earlier on:

/content/sd-model
Initialized empty Git repository in /content/sd-model/.git/
Updating origin
fatal: unable to access 'https://USER:https://huggingface.co/settings/[email protected]/CompVis/stable-diffusion-v-1-4-original/': Port number ended with 'h'
error: Could not fetch origin
fatal: unable to access 'https://USER:https://huggingface.co/settings/[email protected]/CompVis/stable-diffusion-v-1-4-original/': Port number ended with 'h'
/content
Cloning into '/content/stable-diffusion'...
remote: Enumerating objects: 2289, done.
remote: Counting objects: 100% (95/95), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 2289 (delta 51), reused 76 (delta 45), pack-reused 2194
Receiving objects: 100% (2289/2289), 18.11 MiB | 20.68 MiB/s, done.
Resolving deltas: 100% (1313/1313), done.
/content/stable-diffusion

Assistance in resolving this would be every much appreciated.

[Bug]: No such file or directory: '/content/drive/MyDrive/AI/models/sd-v1-4.ckpt' => No interface running

What happened?

Hi,
I try for the first time to run the Colab page " Stable Diffusion WebUI 1.4!" . I had error at the last step where i have that message:
Loading model from /content/drive/MyDrive/AI/models/sd-v1-4.ckpt
Traceback (most recent call last):
File "scripts/webui.py", line 337, in
sd = load_sd_from_config(opt.ckpt)
File "scripts/webui.py", line 148, in load_sd_from_config
pl_sd = torch.load(ckpt, map_location="cpu")
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 699, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 212, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/AI/models/sd-v1-4.ckpt'
and when I try : "https://49817.gradio.app/" I have a 502 error message with "No interface is running right now"

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

Traceback (most recent call last):
  File "scripts/webui.py", line 337, in <module>
    sd = load_sd_from_config(opt.ckpt)
  File "scripts/webui.py", line 148, in load_sd_from_config
    pl_sd = torch.load(ckpt, map_location="cpu")
  File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 231, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 212, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/AI/models/sd-v1-4.ckpt'

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize'

What happened?

ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize'

File "/content/stable-diffusion/optimizedSD/ddpm.py", line 14, in
from ldm.models.autoencoder import VQModelInterface
File "/content/stable-diffusion/ldm/models/autoencoder.py", line 6, in
from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer
ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize' (/usr/local/lib/python3.8/site-packages/taming/modules/vqvae/quantize.py)

In addition, there are other things that need to be installed, pip
!pip install gradio pynvml einops omegaconf pytorch_lightning taming-transformers

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

No response

Where are you running the webui?

No response

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Question]: how to run GFPGAN and ESRGAN

What happened?

I don't seem to be able to run either GFPGAN or ESRGAN
whether from the Gui tab or as an option after the generation of an image

do I have to download the required models?
and if so, where do I need to store them?

p.s.
I am not able to raise a simple question, it looks like I can only raise bug

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Colab

Custom settings

none

Relevant log output

nothing pops in there after generation
e.g.
Iteration: 1/1
100% 38/38 [00:14<00:00,  2.58it/s]
[MemMon] Stopped recording.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: No module named 'gradio'

What happened?

Running normally.

Got to 3 - Launch WebUI.

Error message.

Traceback (most recent call last):
File "scripts/webui.py", line 3, in
from frontend.frontend import draw_gradio_ui
File "/content/stable-diffusion/frontend/frontend.py", line 1, in
import gradio as gr
ModuleNotFoundError: No module named 'gradio'

Someone told me to tell it to
!pip install gradio

No idea where to put that, or in what file tho.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Firefox

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

Traceback (most recent call last):
  File "scripts/webui.py", line 3, in <module>
    from frontend.frontend import draw_gradio_ui
  File "/content/stable-diffusion/frontend/frontend.py", line 1, in <module>
    import gradio as gr
ModuleNotFoundError: No module named 'gradio'

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]:

What happened?

I run into this error and the images saved to drive are just black: Exception: No usable font found (tried arial.ttf, DejaVuSans.ttf)

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Firefox

Where are you running the webui?

Colab

Custom settings

No response

Relevant log output

File "scripts/webui.py", line 419, in image_grid
    fnt = get_font(30)
  File "scripts/webui.py", line 401, in get_font
    raise Exception(f"No usable font found (tried {', '.join(fonts)})")
Exception: No usable font found (tried arial.ttf, DejaVuSans.ttf)

Code of Conduct

  • I agree to follow this project's Code of Conduct

It is not clear which model to get from the compvis

Hello,

Thank you for the colab, really cool idea ! Having issue with connecting to the model.

The link provided to download the model links to the one with diffuser and no packaged model. Should we use this link ? https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main

Also, if so should we get sd-v1-4-full-ema.ckpt or sd-v1-4.ckpt and keep them named as they are ?

Else, should we get all the files and folders from here : https://huggingface.co/CompVis/stable-diffusion-v1-4/tree/main

I would recommend starting the colab with a detailed explanation on this part. If you can clarify this for me, I can update the colab with that and send it back to you to push here :)

Thank you,

Abdé

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.