cbh123 / charl-e Goto Github PK
View Code? Open in Web Editor NEWRun Stable Diffusion on your M1 Mac
License: MIT License
Run Stable Diffusion on your M1 Mac
License: MIT License
main
branchDEBUG_PROD=true npm run build && npm start
When running npm install
right after git clone, the install should not fail.
npm install
fails when it reaches the postinstall
script.
There are two problems I have encountered:
First, when I run npm install
, it installs dependencies and runs the postinstall
script, at which point the script fails, complaining about the lack of "type": "module"
declaration:
> [email protected] postinstall
> ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts
(node:37969) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/XXX/Projects/charl-e/.erb/scripts/check-native-dep.js:1
import fs from 'fs';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1048:15)
at Module._compile (node:internal/modules/cjs/loader:1083:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
at Object.require.extensions.<computed> [as .js] (/Users/XXX/Projects/charl-e/node_modules/ts-node/src/index.ts:1608:43)
I don't know how this is working on your machine but I assume you have to put "type": "module" in package.json so I added it and tried running npm install
again.
But now I have a second issue:
> ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///Users/XXX/Projects/charl-e/package.json" needs an import assertion of type "json"
In this case I thought this was because you're using some edge node.js version that supports features not supported by stable version, so I even tried updating my node.js version to the latest 18.9.0
and ran the command again, but it still fails with the same error.
My questions are:
import
syntax without specifying the "type": "module"
inside package.json
? And do we need to add that line in the package.json file?npm install
without failing?I downloaded from https://www.charl-e.com/ moved to applications and tried to launch, and the app icon just bounced for a few minutes and then stopped. No window opened or anything.
Macbook Pro, M1 Pro, 8C 14G 16GB, v0.0.6
UPDATE: It's been 12 minutes since I posted this issue. I'm going to call it and say it doesn't open.
It might be nice to type in multiple prompts and have the ui generate them one after another. That way, I could try a bunch of things, go to lunch, come back and see them all. :)
Is it possible to clear my gallery?
After removing the generated images from disk, my gallery shows the prompt strings still. I believe these entries are stored locally and I'm unsure how to remove orphaned prompts.
Thanks!
main
branchDEBUG_PROD=true npm run build && npm start
Picture should not bounce.
Picture bounce if window is too small, typically at macBook's internal display.
Generate picture
Wait for that grand finale effect
Scroll down
Hi, I installed the app from https://www.charl-e.com/ on my macbook pro with the M1 chip, and downloaded the weights. When trying to generate an image for the first time, I got the following error during sampling. Seems like there are some unrecognized arguments to txt2img
. There are also other warnings whcih look harmless. Any suggestions as to how this could be resolved?
usage: txt2img [-h] [--prompt [PROMPT]] [--outdir [OUTDIR]] [--skip_grid] [--skip_save] [--ddim_steps DDIM_STEPS] [--plms] [--laion400m] [--fixed_code] [--ddim_eta DDIM_ETA] [--n_iter N_ITER] [--H H] [--W W] [--C C] [--f F] [--n_samples N_SAMPLES] [--n_rows N_ROWS] [--scale SCALE] [--from-file FROM_FILE] [--config CONFIG] [--ckpt CKPT] [--seed SEED] [--precision {full,autocast}] txt2img: error: unrecognized arguments: -B -S -E -s -c from multiprocessing.resource_tracker import main;main(8)
transformers/models/clip/feature_extraction_clip.py:204: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
transformers/image_utils.py:188: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead. transformers/models/clip/feature_extraction_clip.py:67: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x17fb6f6d0>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x17fb6f520>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
[6726] WARNING: file already exists but should not: /var/folders/7w/0kc1g1ls7433kzx857kfhzfw0000gn/T/_MEISbBy9u/torch/_dl.cpython-310-darwin.so
[6726] WARNING: file already exists but should not: /var/folders/7w/0kc1g1ls7433kzx857kfhzfw0000gn/T/_MEISbBy9u/torch/_C_flatbuffer.cpython-310-darwin.so
[6726] WARNING: file already exists but should not: /var/folders/7w/0kc1g1ls7433kzx857kfhzfw0000gn/T/_MEISbBy9u/torch/_C.cpython-310-darwin.so
[6726] WARNING: file already exists but should not: /var/folders/7w/0kc1g1ls7433kzx857kfhzfw0000gn/T/_MEISbBy9u/pyarrow/lib.cpython-310-darwin.so
Sampling: 0%| | 0/1 [00:00<?, ?it/s] data: 0%| | 0/1 [00:00<?, ?it/s]�[A
It's ok, you can tell us, we'll move on.
Thanks for the effort.
Hello,
Would it be possible that we add a job queue that lets you add queued generations, this way I can set it up with a days worth of prompts.
Thanks, this tech is incredible.
Hello,
Awesome to be able to install txt2img on Mac this easy! Great job!
mid ut possible to add other txt2img commands directly in the prompt field?
or running txt2img through terminal?
Running latest macos on a m1 pro max 64gb MacBook
Attempting to run charl-e on my M1 macbook pro and it fails to move past initialization.
Logs show:
usage: txt2img [-h] [--prompt [PROMPT]] [--outdir [OUTDIR]] [--skip_grid] [--skip_save] [--ddim_steps DDIM_STEPS] [--plms] [--laion400m] [--fixed_code] [--ddim_eta DDIM_ETA] [--n_iter N_ITER] [--H H] [--W W] [--C C] [--f F] [--n_samples N_SAMPLES] [--n_rows N_ROWS] [--scale SCALE] [--from-file FROM_FILE] [--config CONFIG] [--ckpt CKPT] [--seed SEED] [--precision {full,autocast}] txt2img: error: unrecognized arguments: -B -S -E -s -c from multiprocessing.resource_tracker import main;main(9)
transformers/models/clip/feature_extraction_clip.py:67: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead. transformers/models/clip/feature_extraction_clip.py:204: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
transformers/image_utils.py:188: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x168f6b520>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.") torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x168f6b6d0>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
[2111] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEItcVSBe/torch/_dl.cpython-310-darwin.so
[2111] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEItcVSBe/torch/_C_flatbuffer.cpython-310-darwin.so
[2111] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEItcVSBe/torch/_C.cpython-310-darwin.so
[2111] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEItcVSBe/pyarrow/lib.cpython-310-darwin.so
multiprocessing/resource_tracker.py:104: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.
RuntimeError: expected scalar type BFloat16 but found Float [2092] Failed to execute script 'txt2img' due to unhandled exception!
DDIM Sampler: 0%| | 0/5 [00:04<?, ?it/s] data: 0%| | 0/1 [01:19<?, ?it/s] Sampling: 0%| | 0/1 [01:19<?, ?it/s]
DDIM Sampler: 0%| | 0/5 [00:00<?, ?it/s]�[A�[A
usage: txt2img [-h] [--prompt [PROMPT]] [--outdir [OUTDIR]] [--skip_grid] [--skip_save] [--ddim_steps DDIM_STEPS] [--plms] [--laion400m] [--fixed_code] [--ddim_eta DDIM_ETA] [--n_iter N_ITER] [--H H] [--W W] [--C C] [--f F] [--n_samples N_SAMPLES] [--n_rows N_ROWS] [--scale SCALE] [--from-file FROM_FILE] [--config CONFIG] [--ckpt CKPT] [--seed SEED] [--precision {full,autocast}] txt2img: error: unrecognized arguments: -B -S -E -s -c from multiprocessing.resource_tracker import main;main(9)
transformers/models/clip/feature_extraction_clip.py:67: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead. transformers/models/clip/feature_extraction_clip.py:204: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
transformers/image_utils.py:188: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x16b5fb520>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.") torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x16b5fb6d0>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
[2094] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEIBcxlVe/torch/_dl.cpython-310-darwin.so
[2094] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEIBcxlVe/torch/_C_flatbuffer.cpython-310-darwin.so
[2094] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEIBcxlVe/torch/_C.cpython-310-darwin.so
[2094] WARNING: file already exists but should not: /var/folders/nc/n0_cfz7n01bbqqj17x5g39xr0000gn/T/_MEIBcxlVe/pyarrow/lib.cpython-310-darwin.so
Not sure how to troubleshoot. Any help would be appreciated.
main
branchDEBUG_PROD=true npm run build && npm start
You should be able to enter a lengthy prompt, for example:
powerful dark matter mancer, dark soul 3, Extra-Wide Angle, 3d zbrush, trend on ArtStation, Realistic Lighting, Volumetric Lighting, dramatic, 8k, cinematic, super detailed, vfx, symmetrical face and body, full body portrait, cinematic lighting, hyperdetailed, detailed realistic symmetrical eyes, cinematic lighting, hyperdetailed, cgsociety, 8k, high resolution, noah bradley, Billelis, masamune shirow, katsuhiro Otomo, insanely detailed and intricate, dark, dramatic, powerful, poster, cinematic Lighting through volume, Style=render, highly detail render with octane, octane render, color black and gold, photorealistic
and have the image generate.
Currently, the filename is saved as the description, with spaces replaced with dashes, and .png
added to the suffix. If this filename exceeds 255 characters, the following error is thrown and the program halts:
OSError: [Errno 63] File name too long: '<filename here>[25502] Failed to execute script 'txt2img' due to unhandled exception!
is there a way to pass negative prompts into the text input?
macOS 12.5.1
M1 MAX (64GB)
charl-e 0.0.6
errors like [84341] WARNING: file already exists but should not: /var/folders/s3/nryq86dj67154k8lx9k5v2ph0000gp/T/_MEIzzRWoc/torch/_dl.cpython-310-darwin.so
or transformers/models/clip/modeling_clip.py:657: UserWarning: The operator 'aten::index.Tensor' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)
full log: charle.log
I never finished a render. Installed charl-e today and restarted charl-e a couple of times already. Only changed DDIM sampling to 36 before the first render.
(Pardon my ignorance, python isn't my main environment)
It looks like txt2img is a binary blob- I can't seem to find any build info or script (maybe I missed it?) for building it.
How can I rebuild it?
Thanks
I've changes the default path from the Desktop too my Pictures folder but although the existing prompts are shows in the gallery the images are not.
When I create a new image from a prompt it's correctly saved in the samples directory so I know the path is correct.
Using the release 0.0.5 (which still shows as v0.0.3 in the logs btw)
Should generate an Image
Displays Error Detected! Please check the logs.
Logs:
0
Logs
\
Options
?
CHARL-E v0.0.3
19:57:34
usage: txt2img [-h] [--prompt [PROMPT]] [--outdir [OUTDIR]] [--skip_grid] [--skip_save] [--ddim_steps DDIM_STEPS] [--plms] [--laion400m] [--fixed_code] [--ddim_eta DDIM_ETA] [--n_iter N_ITER] [--H H] [--W W] [--C C] [--f F] [--n_samples N_SAMPLES] [--n_rows N_ROWS] [--scale SCALE] [--from-file FROM_FILE] [--config CONFIG] [--ckpt CKPT] [--seed SEED] [--precision {full,autocast}] txt2img: error: unrecognized arguments: -B -S -E -s -c from multiprocessing.resource_tracker import main;main(11)
transformers/models/clip/feature_extraction_clip.py:67: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead. transformers/models/clip/feature_extraction_clip.py:204: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
transformers/image_utils.py:188: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x29386b6d0>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch/_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x29386b520>. warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
Failed to execute script 'txt2img' due to unhandled exception!
[83539]
Traceback (most recent call last): File "PIL/Image.py", line 2298, in save KeyError: '' The above exception was the direct cause of the following exception: Traceback (most recent call last):
data: 100%|██████████| 1/1 [00:04<00:00, 4.96s/it]�[A data: 100%|██████████| 1/1 [00:04<00:00, 4.96s/it] Sampling: 100%|██████████| 1/1 [00:04<00:00, 4.96s/it] Sampling: 100%|██████████| 1/1 [00:04<00:00, 4.96s/it]
PLMS Sampler: 100%|██████████| 5/5 [00:04<00:00, 1.41it/s]�[A�[A PLMS Sampler: 100%|██████████| 5/5 [00:04<00:00, 1.17it/s]
PLMS Sampler: 80%|████████ | 4/5 [00:03<00:00, 1.26it/s]�[A�[A
PLMS Sampler: 60%|██████ | 3/5 [00:03<00:01, 1.15it/s]�[A�[A
[83580] WARNING: file already exists but should not: /var/folders/d9/yx7f4q2j4wj3z6ld97kpssnc0000gn/T/_MEIHLbnro/torch/_dl.cpython-310-darwin.so
[83580] WARNING: file already exists but should not: /var/folders/d9/yx7f4q2j4wj3z6ld97kpssnc0000gn/T/_MEIHLbnro/torch/_C_flatbuffer.cpython-310-darwin.so
[83580] WARNING: file already exists but should not: /var/folders/d9/yx7f4q2j4wj3z6ld97kpssnc0000gn/T/_MEIHLbnro/torch/_C.cpython-310-darwin.so
PLMS Sampler: 40%|████ | 2/5 [00:02<00:03, 1.12s/it]�[A�[A
PLMS Sampler: 20%|██ | 1/5 [00:01<00:07, 1.86s/it]�[A�[A
[83580] WARNING: file already exists but should not: /var/folders/d9/yx7f4q2j4wj3z6ld97kpssnc0000gn/T/_MEIHLbnro/pyarrow/lib.cpython-310-darwin.so
PLMS Sampler: 0%| | 0/5 [00:00<?, ?it/s]�[A�[A
transformers/models/clip/modeling_clip.py:657: UserWarning: The operator 'aten::index.Tensor' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)
data: 0%| | 0/1 [00:00<?, ?it/s]�[A
Sampling: 0%| | 0/1 [00:00<?, ?it/s]
``m
## Steps to Reproduce
<!-- Add relevant code and/or a live example -->
<!-- Add stack traces -->
1. Download v0.0.5
2. click Generate
## Your Environment
- M1 Max MacBook Pro 16" 64GB Ram.
- MacOS Montery v12.5.1
First, thank you for maintaining this project, this project is really interesting. I spent a whole day trying out various stable diffusion prompts with this app.
One thing that bothers me is small imperfection from the output images. I believe running the txt2img output result through few img2img cycles can improve the result significantly. Do you have any plans to add img2img feature to this app, or maybe including a img2img binary inside the app without GUI to allow power users to tinker with the original program without setting up the painful development environment?
Having the same parameters configured and the same prompt, the image should be the same all the time. Using the seed number should make this image generation deterministic.
With the same parameters configured and the same prompt, every time the "generate" button is clicked a totally different image is generated.
It's impossible to tinker an image if the image changes completely every time the image is generated.
PD: Thanks for this project, it's amazing!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.