diffusionbee-stable-diffusion-ui icon indicating copy to clipboard operation
diffusionbee-stable-diffusion-ui copied to clipboard

Instructions to build the repo

Open highfiiv opened this issue 1 year ago • 25 comments

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

highfiiv avatar Sep 17 '22 17:09 highfiiv

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

opencoca avatar Sep 18 '22 22:09 opencoca

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

divamgupta avatar Sep 19 '22 02:09 divamgupta

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 avatar Sep 19 '22 22:09 gammons

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

gammons avatar Sep 19 '22 22:09 gammons

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...

schvenk avatar Sep 20 '22 03:09 schvenk

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

gammons avatar Sep 20 '22 11:09 gammons

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

schvenk avatar Sep 20 '22 13:09 schvenk

The HF_weights file is on the .gitignore files:

  • https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/blob/32e4c329d6620f15c9f90cbbea4a7f48c6bb13d3/backends/stable_diffusion_torch/.gitignore#L1
  • https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/blob/d061e673b472b36a5036d80a6737780f8284256d/.gitignore#L5

could you include the HF_weights file in the repo?

polaski avatar Sep 20 '22 20:09 polaski

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.

polaski avatar Sep 24 '22 17:09 polaski

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 avatar Sep 24 '22 17:09 divamgupta

@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

polaski avatar Sep 24 '22 19:09 polaski

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 avatar Sep 24 '22 19:09 jehan60188

@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?

polaski avatar Sep 24 '22 19:09 polaski

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?

azumbrunnen avatar Sep 26 '22 00:09 azumbrunnen

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 avatar Sep 29 '22 00:09 odieXin

@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 avatar Sep 29 '22 00:09 odieXin

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.

odieXin avatar Sep 29 '22 00:09 odieXin

Because the other one is running on Tensorflow and is gpu accelerated I’d guess.

So the problem isn’t npm build, the fake backend is super useful. You need to set the PY_SCRIPT variable and point it to the real backend (diffusebee).

This will only work though if you have all the metal dependencies setup correctly

On Thu, 29 Sep 2022 at 02:27, odieXin @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/issues/62#issuecomment-1261599426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA3UJHT477I6I5BDENFCELWATPA5ANCNFSM6AAAAAAQPCYE4Y . You are receiving this because you commented.Message ID: @.*** com>

azumbrunnen avatar Sep 29 '22 01:09 azumbrunnen

@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.

whab avatar Sep 30 '22 08:09 whab

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

gammons avatar Sep 30 '22 10:09 gammons

You don’t need to build unless you are ready to ship it. I suggest you use electron:serve instead and start investigating on how to get the backend to work.

On Fri, 30 Sep 2022 at 12:39, Grant Ammons @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/divamgupta/diffusionbee-stable-diffusion-ui/issues/62#issuecomment-1263409719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA3UJGHI75FSZGQL45ZFXTWA27PPANCNFSM6AAAAAAQPCYE4Y . You are receiving this because you commented.Message ID: @.*** com>

azumbrunnen avatar Sep 30 '22 11:09 azumbrunnen

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.

jeffreysfridge avatar Oct 01 '22 22:10 jeffreysfridge

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

zlich avatar Oct 02 '22 15:10 zlich

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!

odieXin avatar Oct 04 '22 00:10 odieXin

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.

ghost avatar Oct 04 '22 16:10 ghost

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 avatar Dec 19 '22 12:12 mymagicpower

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

mymagicpower avatar Dec 21 '22 08:12 mymagicpower

@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 :)

fortinmike avatar May 06 '23 00:05 fortinmike