Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
MIT License
367 stars 19 forks source link

Help getting started #61

Closed jffaust closed 20 hours ago

jffaust commented 1 month ago

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.

Chaoses-Ib commented 1 month ago

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

cd ComfyScript
python -m pip install -e ".[default]"
jffaust commented 1 month ago

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

Chaoses-Ib commented 1 month ago

🤔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 commented 20 hours ago

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