ComfyScript icon indicating copy to clipboard operation
ComfyScript copied to clipboard

Fooocus ksampler vs kSampler Fooocus conflict

Open cihangoksu opened this issue 1 year ago • 4 comments

Hi,

I am using both Fooocus kSampler from both Fooocus_Nodes and from comfyui-art-venture:

Image

As far as i understand, they are both defined as "FooocusKSampler" by ComfyScript: For example; "_, img_out = FooocusKSampler(pipe3, "Preview", "ComfyUI", model)["result"]"

How do we choose FooocusKSampler defined from Fooocus_Nodes in our comfyscript output?

Thank you in advance!

Cheers, Cihan

P.S: Example workflow:

dream-label-report-API.json

ComfyScript Output: image = TextImageZho('NEKODU', 'Merienda-ExtraBold', 'center', 0, 150, 'red', 0, 'blue', 0, 100, 1024, 1024, True, False, 100, 180, 360) PreviewImage(image) positive_prompt_text_g, negative_prompt_text_g = SDXLPromptStyler('A (wolf:1.2) on the street at night, (NEKODU:1.2), clear background', 'blur', 'base', 'No', '') positive_prompt_text_g = FooocusPositive(positive_prompt_text_g) negative_prompt_text_g = FooocusNegative(negative_prompt_text_g) lora_stack = FooocusLoraStack(True, 1, None, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1, 'None', 1) pipe = FooocusLoader('dreamshaperXL_lightningDPMSDE.safetensors', 'Baked VAE', 'None', 0.5, 'joint', 2, positive_prompt_text_g, negative_prompt_text_g, '1024 x 1024', 1024, 1024, 1, lora_stack) fooocus_styles = FooocusStyles('fooocus_styles') pipe, model, _, _, _, _ = FooocusPreKSampler(pipe, 8, 4, 'dpmpp_sde', 'karras', 569298635963817, 1, 'Simple', 2, 7, 1.5, 0.8, 0.3, 0.25, False, None, None, None, fooocus_styles) mask = ImageToMask(image, 'red') image2 = MaskToImage(mask) pipe, image2 = FooocusControlnet(pipe, image2, 'PyraCanny', 0.8, 1.5, False) PreviewImage(image2)

_, _ = FooocusKSampler(pipe, 'Preview', 'ComfyUI', model)

cihangoksu avatar Feb 24 '25 07:02 cihangoksu

Additional comment: I guess it is FooocusKSampler_ node but If I run that I am facing the following error:

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument weight in method wrapper_CUDA__native_group_norm)

cihangoksu avatar Feb 24 '25 07:02 cihangoksu

It should be FooocusKSampler_. You can check its type stub. Conflicting names (nodes/types) will be suffixed with underscores. This is sometimes misleading but I havn't found a better way that is also short.

That error is probably caused by the same problem as in #94?

Chaoses-Ib avatar Feb 24 '25 07:02 Chaoses-Ib

Although it is the same error, this time it may not be caused because of threading. I get the error sometimes even in the web ui. Also getting the same error by just running at the first execution

cihangoksu avatar Feb 24 '25 07:02 cihangoksu

I get the error sometimes even in the web ui.

Then it's probably the node itself's problem. Maybe you can report to the author? Though it looks a bit unmaintained...

Chaoses-Ib avatar Feb 24 '25 08:02 Chaoses-Ib