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

Simplify for newbies #3

Open
aolko opened this issue Jan 1, 2024 · 4 comments
Open

Simplify for newbies #3

aolko opened this issue Jan 1, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers runtime

Comments

@aolko
Copy link

aolko commented Jan 1, 2024

Please abstract/merge some of the methods for newbies.

@Chaoses-Ib Chaoses-Ib added the enhancement New feature or request label Jan 1, 2024
@Chaoses-Ib
Copy link
Owner

For example?

These methods are one-to-one mappings of ComfyUI nodes. If one wants some all-in-one methods, many custom node packs are available.

@aolko
Copy link
Author

aolko commented Jan 1, 2024

For example all that noise, vae encoding/decoding and sampling bs can be just one node (or just one method), same for controlnets (load controlnet,apply controlnet)

@Chaoses-Ib
Copy link
Owner

This can be simply done by defining functions:

def sample(model_name: CheckpointLoader.ckpt_name, pos: str, neg: str, seed: int = 0, steps: int = 20) -> Image:
    model, clip, vae = CheckpointLoaderSimple(model_name)
    latent = EmptyLatentImage(512, 512, 1)
    latent = KSampler(model, seed, steps, 8, 'euler', 'normal', CLIPTextEncode(pos, clip), CLIPTextEncode(neg, clip), latent, 1)
    return VAEDecode(latent, vae)

with Workflow():
    pos = 'beautiful scenery nature glass bottle landscape, , purple galaxy bottle,'
    neg = 'text, watermark'
    image = sample(model_name=CheckpointLoader.ckpt_name.v1_5_pruned_emaonly, pos=pos, neg=neg, seed=123)
    SaveImage(image, f'test')

But I'm hesitant to introduce things like this, because they can be very personal. If a person doesn't know how to code the workflow, he can just copy someone else's workflow and use it; if he does know, he may not need these as much because they're not flexible enough.

If you are interested in this, you can create a repository and put your utility functions there. I'll add a link to it in the readme, or just make it installed by default.

@aolko
Copy link
Author

aolko commented Jan 1, 2024

I might fork it if only it has a separate unified comfy core, not a bunch of scripts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers runtime
Projects
None yet
Development

No branches or pull requests

2 participants