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

Instructions to build the repo #62

Open
highfiiv opened this issue Sep 17, 2022 · 28 comments
Open

Instructions to build the repo #62

highfiiv opened this issue Sep 17, 2022 · 28 comments

Comments

@highfiiv
Copy link

Can someone add the instructions to simply build the repo if they don't want to use the downloader?

@opencoca
Copy link

We'll assume that things are built around https://www.electron.build/configuration/dmg

@divamgupta
Copy link
Owner

First run build.sh in stable-diffusion and follow the readme in the electron app.
Proper build instructions will be posted soon

@gammons
Copy link

gammons commented Sep 19, 2022

I ran build.sh which seems like it did a lot of things. However, I am running into an issue when trying to run locally:

stderr: Traceback (most recent call last):
  File "/Users/grantammons/local_code/diffusionbee-stable-diffusion-ui/electron_app/../stable-diffusion/txt2img.py", line 340, in <module>
stderr:     main()
  File "/Users/grantammons/local_code/diffusionbee-stable-diffusion-ui/electron_app/../stable-diffusion/txt2img.py", line 293, in main
    model = load_model_from_config(config, f"{opt.ckpt}")
  File "/Users/grantammons/local_code/diffusionbee-stable-diffusion-ui/electron_app/../stable-diffusion/txt2img.py", line 113, in load_model_from_config
    model = instantiate_from_config(config.model)
stderr:   File "/Users/grantammons/local_code/diffusionbee-stable-diffusion-ui/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
TypeError: __init__() missing 1 required positional argument: 'personalization_config'

Any help would be appreciated!

@gammons
Copy link

gammons commented Sep 19, 2022

I've noticed that build.sh makes reference to copying HF_weights, which does not exist. could that be the source of the problem?

@schvenk
Copy link

schvenk commented Sep 20, 2022

I'm seeing:

./build.sh: line 1: pyinstaller: command not found
mkdir: dist/txt2img: No such file or directory
cp: dist/txt2img/clip/bpe_simple_vocab_16e6.txt.gz: No such file or directory
cp: dist/txt2img/configs: No such file or directory
cp: configs: unable to copy extended attributes to dist/txt2img/configs: No such file or directory
cp: dist/txt2img/configs/autoencoder: No such file or directory
cp: configs/autoencoder: unable to copy extended attributes to dist/txt2img/configs/autoencoder: No such file or directory
cp: dist/txt2img/configs/autoencoder/autoencoder_kl_64x64x3.yaml: No such file or directory
cp: dist/txt2img/configs/autoencoder/autoencoder_kl_8x8x64.yaml: No such file or directory
cp: dist/txt2img/configs/autoencoder/autoencoder_kl_32x32x4.yaml: No such file or directory
cp: dist/txt2img/configs/autoencoder/autoencoder_kl_16x16x16.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion: No such file or directory
cp: configs/latent-diffusion: unable to copy extended attributes to dist/txt2img/configs/latent-diffusion: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/cin256-v2.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/celebahq-ldm-vq-4.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/cin-ldm-vq-f8.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/txt2img-1p4B-eval.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/lsun_bedrooms-ldm-vq-4.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/ffhq-ldm-vq-4.yaml: No such file or directory
cp: dist/txt2img/configs/latent-diffusion/lsun_churches-ldm-kl-8.yaml: No such file or directory
cp: dist/txt2img/configs/retrieval-augmented-diffusion: No such file or directory
cp: configs/retrieval-augmented-diffusion: unable to copy extended attributes to dist/txt2img/configs/retrieval-augmented-diffusion: No such file or directory
cp: dist/txt2img/configs/retrieval-augmented-diffusion/768x768.yaml: No such file or directory
cp: dist/txt2img/configs/stable-diffusion: No such file or directory
cp: configs/stable-diffusion: unable to copy extended attributes to dist/txt2img/configs/stable-diffusion: No such file or directory
cp: dist/txt2img/configs/stable-diffusion/v1-inference.yaml: No such file or directory
cp: HF_weights: No such file or directory
mkdir: dist/txt2img: No such file or directory
Right now you gotta copy the weights

...which looks an awful lot like I'm missing some sort of install step...

@gammons
Copy link

gammons commented Sep 20, 2022

@schvenk pip install -U pyinstaller should take care of that for you.

@schvenk
Copy link

schvenk commented Sep 20, 2022

Getting there: what's left is the missing HF_weights already mentioned on this thread:

cp: HF_weights: No such file or directory
Right now you gotta copy the weights

@polaski
Copy link

polaski commented Sep 20, 2022

The HF_weights file is on the .gitignore files:

could you include the HF_weights file in the repo?

@polaski
Copy link

polaski commented Sep 24, 2022

Is anyone able to build this at all? Just curious since no one seems to be asking anymore. Just wondering how those who are sending PRs are even running it locally.

@divamgupta
Copy link
Owner

The torch backend is not used anymore.
Try running build.sh from https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/tree/master/backends/stable_diffusion_tf
And let me know if you get any errors.

@polaski
Copy link

polaski commented Sep 24, 2022

@divamgupta thank you for the pointer, i did manage to get it to build through tf backend.

But for some reason it's just giving me "diffusionbee test image" regardless of what prompt I enter. What might I be doing wrong?

starbucks-exif-remove

[EDIT]

I see the error messages in the console. Looks like it's treating it like an empty prompt

Python response:  sbdk errr The string is blank
Python response:  sdbk inwk
sdbk dnpr 0
Python response:  sdbk dnpr 5
Python response:  sdbk dnpr 10
Python response:  sdbk dnpr 15
Python response:  sdbk dnpr 20
Python response:  sdbk dnpr 25
Python response:  sdbk dnpr 30
Python response:  sdbk dnpr 35
Python response:  sdbk dnpr 40
Python response:  sdbk dnpr 45
Python response:  sdbk dnpr 50
Python response:  sdbk dnpr 55
Python response:  sdbk dnpr 60
Python response:  sdbk dnpr 65
Python response:  sdbk dnpr 70
Python response:  sdbk dnpr 75
Python response:  sdbk dnpr 80
Python response:  sdbk dnpr 85
Python response:  sdbk dnpr 90
Python response:  sdbk dnpr 95
Python response:  sdbk nwim /Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/src/assets/sample.png?6369
sdbk inrd

@jehan60188
Copy link

Are you using the npm run electron:serve command? I think that's for developing the frontend, which plugs into a dummy backend (so it returns the same image every time, just to serve as a 'smoke test' of sorts)

@polaski
Copy link

polaski commented Sep 24, 2022

@jehan60188 I tried building using npm run electron:build but get the following error:

Error: ENAMETOOLONG: name too long, copyfile '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747' -> '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at walk (/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/builder-util/src/fs.ts:77:51)
    at /Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/app-builder-lib/src/fileMatcher.ts:351:12 {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'copyfile',
  path: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747',
  dest: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
}

Have you successfully built the electron app on your end?

@azumbrunnen
Copy link

azumbrunnen commented Sep 26, 2022

ModuleNotFoundError: No module named 'tqdm' I get this when I want to run 'diffusionbee_backend' that I compiled. Did ANYONE get this to work?

The torch backend is not used anymore.
Try running build.sh from https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/tree/master/backends/stable_diffusion_tf
And let me know if you get any errors.

I installed conda, metal drivers, and everything and still can't compile. Would you share quick steps to help us build it?

@odieXin
Copy link

odieXin commented Sep 29, 2022

Are you using the npm run electron:serve command? I think that's for developing the frontend, which plugs into a dummy backend (so it returns the same image every time, just to serve as a 'smoke test' of sorts)

@jehan60188 Instead of using npm run electron:serve what would you suggest? Yes, when I used npm run electron:serve I ran into the same error that the fake_backend.py is used, even if I have run both the torch and tf backend.

@odieXin
Copy link

odieXin commented Sep 29, 2022

@jehan60188 I tried building using npm run electron:build but get the following error:

Error: ENAMETOOLONG: name too long, copyfile '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747' -> '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at walk (/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/builder-util/src/fs.ts:77:51)
    at /Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/app-builder-lib/src/fileMatcher.ts:351:12 {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'copyfile',
  path: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747',
  dest: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
}

Have you successfully built the electron app on your end?

I've run into the same error after switching from torch to tf backend.

@odieXin
Copy link

odieXin commented Sep 29, 2022

The torch backend is not used anymore.
Try running build.sh from https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/tree/master/backends/stable_diffusion_tf
And let me know if you get any errors.

Can I know why is torch backend on longer supported? Thanks.

@azumbrunnen
Copy link

azumbrunnen commented Sep 29, 2022 via email

@whab
Copy link

whab commented Sep 30, 2022

@jehan60188 I tried building using npm run electron:build but get the following error:

Error: ENAMETOOLONG: name too long, copyfile '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747' -> '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at walk (/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/builder-util/src/fs.ts:77:51)
    at /Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/node_modules/vue-cli-plugin-electron-builder/node_modules/app-builder-lib/src/fileMatcher.ts:351:12 {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'copyfile',
  path: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747',
  dest: '/Users/AAA/diffusionbee-stable-diffusion-ui/electron_app/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/dist_electron/mac-arm64/DiffusionBee.app/Contents/Resources/core/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d2/8a/8fb89adf1df2181e5454775bca60740e9bf2bb252e93123616b6c3fb34e92c4f8c0ed6803b1170bbfef52381a5c3e9deccaf01f89e0883c81f723cf90747'
}

Have you successfully built the electron app on your end?

I've run into the same error after switching from torch to tf backend.

Same error for me. It looks like a copy recursion loop issue.

@gammons
Copy link

gammons commented Sep 30, 2022

@divamgupta it'd be great if you could provide some help here. it would unlock the ability for others to contribute to the project!

@azumbrunnen
Copy link

azumbrunnen commented Sep 30, 2022 via email

@jeffreysfridge
Copy link

Proper build instructions will be posted soon

Have these instructions been posted yet? I see new features have been added to the app and I'm eager to try them, but I can't figure out how to run the app and get any results besides the "sample.png" of the astronaut riding a horse image.

@zlich
Copy link

zlich commented Oct 2, 2022

Here are the steps to run DiffusionBee with actual TF backend. Hope this helps.

  1. Clone Diffusion Bee repo
    git clone https://github.com/divamgupta/diffusionbee-stable-diffusion-ui.git

  2. Go in diffusionbee-stable-diffusion-ui
    cd diffusionbee-stable-diffusion-ui

  3. Create your working branch
    git checkout -b working

  4. Go in Backend Folder to download requirements and run build.sh
    cd backends/stable_diffusion_tf

    pip install -r requirements_m1.txt

    sh build.sh

  5. Go to electron_app folder and open in VS Code

    cd ../../electron_app

    code .

  6. Point DiffusionBee to actual TF backend
    Open src/bridge.js in Code. Replace line 15 with following and save

    //let script_path = process.env.PY_SCRIPT || "./src/fake_backend.py";
    let script_path = process.env.PY_SCRIPT || "../backends/stable_diffusion_tf/diffusionbee_backend.py";

  7. Back in terminal, install required node modules

    npm i

  8. Run DiffusionBee
    npm run electron:serve

  9. ENJOY!!!

image

@odieXin
Copy link

odieXin commented Oct 4, 2022

Here are the steps to run DiffusionBee with actual TF backend. Hope this helps.

  1. Clone Diffusion Bee repo
    git clone https://github.com/divamgupta/diffusionbee-stable-diffusion-ui.git
  2. Go in diffusionbee-stable-diffusion-ui
    cd diffusionbee-stable-diffusion-ui
  3. Create your working branch
    git checkout -b working
  4. Go in Backend Folder to download requirements and run build.sh
    cd backends/stable_diffusion_tf
    pip install -r requirements_m1.txt
    sh build.sh
  5. Go to electron_app folder and open in VS Code
    cd ../../electron_app
    code .
  6. Point DiffusionBee to actual TF backend
    Open src/bridge.js in Code. Replace line 15 with following and save
    //let script_path = process.env.PY_SCRIPT || "./src/fake_backend.py";
    let script_path = process.env.PY_SCRIPT || "../backends/stable_diffusion_tf/diffusionbee_backend.py";
  7. Back in terminal, install required node modules
    npm i
  8. Run DiffusionBee
    npm run electron:serve
  9. ENJOY!!!
image

This instruction works great, thanks!
`npm run electron:serve' still fails, with the error message of "Error: ENAMETOOLONG: name too long". Any idea? Thanks!

@ghost
Copy link

ghost commented Oct 4, 2022

The torch backend is not used anymore. Try running build.sh from https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/tree/master/backends/stable_diffusion_tf And let me know if you get any errors.

@divamgupta the build.sh provided creates a binary that only uses CPU. MPS/M1 etc is not enabled. So looking at ~8s/it on an M1 Pro instead of ~1s/it.

@mymagicpower
Copy link

mymagicpower commented Dec 19, 2022

Here are the steps to run DiffusionBee with actual TF backend. Hope this helps.

  1. Clone Diffusion Bee repo
    git clone https://github.com/divamgupta/diffusionbee-stable-diffusion-ui.git
  2. Go in diffusionbee-stable-diffusion-ui
    cd diffusionbee-stable-diffusion-ui
  3. Create your working branch
    git checkout -b working
  4. Go in Backend Folder to download requirements and run build.sh
    cd backends/stable_diffusion_tf
    pip install -r requirements_m1.txt
    sh build.sh
  5. Go to electron_app folder and open in VS Code
    cd ../../electron_app
    code .
  6. Point DiffusionBee to actual TF backend
    Open src/bridge.js in Code. Replace line 15 with following and save
    //let script_path = process.env.PY_SCRIPT || "./src/fake_backend.py";
    let script_path = process.env.PY_SCRIPT || "../backends/stable_diffusion_tf/diffusionbee_backend.py";
  7. Back in terminal, install required node modules
    npm i
  8. Run DiffusionBee
    npm run electron:serve
  9. ENJOY!!!
image

This instruction works great, thanks! `npm run electron:serve' still fails, with the error message of "Error: ENAMETOOLONG: name too long". Any idea? Thanks!

"Error: ENAMETOOLONG: name too long" issue is caused by process.env.BACKEND_BUILD_PATH which should be replaced with right value.
`
"extraResources": [{

                "from": process.env.BACKEND_BUILD_PATH , 

               >>>>> "from": "../backends/stable_diffusion_tf/dist/diffusionbee_backend/"

`

I have successfully built frontend and backend for win 10.
image

But another issue related to GPU need to be further investigated:
`
stderr: WARNING:tensorflow:AutoGraph could not transform <function Model.make_predict_function..predict_function at 0x000002024969ECB0> and will run it as-is.
Cause: Unable to locate the source code of <function Model.make_predict_function..predict_function at 0x000002024969ECB0>. Note that functions defined in certain environments, like the interactive Python shell, do not expose their source code. If that is the case, you should define them in a .py source file. If you are certain the code is graph-compatible, wrap the call using @tf.autograph.experimental.do_not_convert. Original error: could not get source code
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

stderr: 2022-12-19 20:07:30.717842: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8600
stderr: Could not locate zlibwapi.dll. Please make sure it is in your library path!
`

@mymagicpower
Copy link

Issue fixed.
`
stderr: WARNING:tensorflow:AutoGraph could not transform <function Model.make_predict_function..predict_function at 0x000002024969ECB0> and will run it as-is.
Cause: Unable to locate the source code of <function Model.make_predict_function..predict_function at 0x000002024969ECB0>. Note that functions defined in certain environments, like the interactive Python shell, do not expose their source code. If that is the case, you should define them in a .py source file. If you are certain the code is graph-compatible, wrap the call using @tf.autograph.experimental.do_not_convert. Original error: could not get source code
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

stderr: 2022-12-19 20:07:30.717842: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8600
stderr: Could not locate zlibwapi.dll. Please make sure it is in your library path!
`
Solution: Download zlib and extract and move dll files to c:\windows\system32.
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-zlib-windows

image

@fortinmike
Copy link
Contributor

fortinmike commented May 6, 2023

@divamgupta I'd just like to reiterate that there's still a need for clear instructions to build this project. In its current state it's a real hurdle for potential contributors. I love what you did with the app, it's my preferred way to generate images but I've used it enough to encounter some pain points (and bugs) which I'd like to help alleviate and fix.

The procedure outlined by @zlich is a starting point, but I have encountered quite a bit more hurdles such as a wrong version of Node.js (I was using 18.X but this project seemingly requires 16.X; it would be nice to add a .nvmrc), wrong version of python (3.8 seems to work, but AFAIK this isn't written anywhere), missing tools such as pyinstall, etc.

When the time comes to run the build.sh file, there are multiple warnings and non-existent paths that the script seems to assume exist (even if pip install -r requirements_m1.txt was run successfully):

72 WARNING: Unable to copy metadata for tensorflow: The 'tensorflow' distribution was not found and is required by the application
3964 INFO: Determining a mapping of distributions to packages...
5430 WARNING: Unable to determine requirements for tensorflow: The 'tensorflow' distribution was not found and is required by the application
5436 WARNING: Unable to copy metadata for tensorflow-plugins: The 'tensorflow-plugins' distribution was not found and is required by the application
5543 WARNING: Unable to determine requirements for tensorflow-plugins: The 'tensorflow-plugins' distribution was not found and is required by the application

[...]

cp: stable_diffusion_tf/clip_tokenizer/bpe_simple_vocab_16e6.txt.gz: No such file or directory
cp: ../realesrgan_ncnn/models: No such file or directory
cp: ../realesrgan_ncnn/realesrgan_ncnn_macos: No such file or directory
cp: ../model_converter/convert_sd_model_bin/m1: No such file or directory

When the time comes to run the Electron app, I get a runtime error:

stderr: Traceback (most recent call last):
  File "../backends/stable_diffusion/diffusionbee_backend.py", line 34, in <module>
    from convert_model import convert_model
  File "/Users/michael/Documents/Projects/diffusionbee-stable-diffusion-ui/backends/stable_diffusion/../model_converter/convert_model.py", line 12, in <module>
    from fake_torch import extract_weights_from_checkpoint
  File "/Users/michael/Documents/Projects/diffusionbee-stable-diffusion-ui/backends/stable_diffusion/../model_converter/fake_torch.py", line 14, in <module>
    from fickling.pickle import Pickled
ModuleNotFoundError: No module named 'fickling'

Etc. etc.

In essence, it's really tough for someone who isn't well-versed in Python (and its pretty complex package / virtual environment ecosystem) to figure out how to run the app. I would personally contribute to the GUI more than the backend(s), so I'd like the Python stuff to just work, but I'm a bit confused by what's happening at the moment. I don't want to just pip install things at random hoping things end up working and not have an easily reproducible setup.

@divamgupta Surely the exact setup requirements are pretty clear to you (say, if you had to setup your project on a brand-new Mac), but it's quite inscrutable to a lot of potential contributors, especially those who aren't working with Python regularly. It'd be incredible if you could write up a detailed procedure to get the project up and running. One way to make sure you don't miss anything would be to setup the project on a new Mac (new user on the same Mac?) or in a different partition to make sure you don't miss any of the dependencies in the instructions. At least that's how I'd proceed.

Thanks in advance :)

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