ComfyScript icon indicating copy to clipboard operation
ComfyScript copied to clipboard

Help getting started

Open jffaust opened this issue 1 year ago • 3 comments

Hello. Thank you for making this project, it is very interesting.

However, I'm having a bit of trouble getting started on using it.

I cloned the repo in the custom_nodes and I was able to run part of the runtime.ipynb notebook in VS Code. Now I'm trying to run a simple python script:

from comfy_script.runtime import *
load()
from comfy_script.runtime.nodes import *

with Workflow():
    model, clip, vae = CheckpointLoaderSimple('v1-5-pruned-emaonly.ckpt')
    conditioning = CLIPTextEncode('beautiful scenery nature glass bottle landscape, , purple galaxy bottle,', clip)
    conditioning2 = CLIPTextEncode('text, watermark', clip)
    latent = EmptyLatentImage(512, 512, 1)
    latent = KSampler(model, 156680208700286, 20, 8, 'euler', 'normal', conditioning, conditioning2, latent, 1)
    image = VAEDecode(latent, vae)
    SaveImage(image, 'ComfyUI')

But I get the error "No module named 'comfy_script' image

I'm not super familiar with python so I'm not sure how the imports are supposed to work. Is "comfy_script" supposed to be folder like in a path? The name of a package/module? I see it's the folder name under the src folder in the repo. Am I supposed to put my script directly in the src folder? I tried a couple different locations and it didn't work.

Thanks a lot for the help.

jffaust avatar Jul 20 '24 19:07 jffaust

Please see the Installation section in README. After cloning, it needs to be installed:

cd ComfyScript
python -m pip install -e ".[default]"

Chaoses-Ib avatar Jul 21 '24 01:07 Chaoses-Ib

Yes I did the pip install and I didn't see any errors there.

jffaust avatar Jul 21 '24 13:07 jffaust

🤔The only possible reason I know is the Python env used to run the script is not the same one the package was installed in, or the ComfyScript directory was moved after the installation.

Chaoses-Ib avatar Jul 21 '24 14:07 Chaoses-Ib

Close because the issue can't be reproduced. Feel free to reopen it if you have further information.

Chaoses-Ib avatar Sep 06 '24 22:09 Chaoses-Ib