ComfyUI_UltimateSDUpscale icon indicating copy to clipboard operation
ComfyUI_UltimateSDUpscale copied to clipboard

Ultimate SD Upscale tiles should take into consideration ControlNet models

Open XpucT opened this issue 1 year ago • 10 comments

https://github.com/ssitu/ComfyUI_UltimateSDUpscale/assets/1196046/818e4fae-f69c-4c50-9f85-ef4d2ff992e0

USDU.json

XpucT avatar Feb 06 '24 21:02 XpucT

Same issue here, looking forward to see the changes!

OliviaOliveiira avatar Feb 06 '24 21:02 OliviaOliveiira

Faced the same problem few days ago. Thought it's just on my side. Please fix it.

ZiBrianQian avatar Feb 07 '24 03:02 ZiBrianQian

It already performs the controlnet per tile, am I misunderstanding?

ssitu avatar Feb 09 '24 03:02 ssitu

It already performs the controlnet per tile, am I misunderstanding?

Yes it working with model, and not with preprocesses.

https://github.com/ssitu/ComfyUI_UltimateSDUpscale/assets/1196046/c0c85887-8638-4506-b8ca-4287720b6c14

XpucT avatar Feb 09 '24 13:02 XpucT

Ah ok I think I understand. A problem will be that the controlnet already runs before the node, so I'll have to throw away the first preprocessed image and reapply every tile, but I think that'll do the job.

ssitu avatar Feb 09 '24 14:02 ssitu

On second thought, I won't have access to the pre-processors, so I won't be able to run them.

ssitu avatar Feb 09 '24 14:02 ssitu

On second thought, I won't have access to the pre-processors, so I won't be able to run them.

ComfyUI_TiledKSampler support slicing controlnets https://github.com/BlenderNeko/ComfyUI_TiledKSampler/blob/4fcc003f62efdbdec2f79eab37e1fb8dd84bac64/nodes.py#L255

bananasss00 avatar Feb 19 '24 14:02 bananasss00

On second thought, I won't have access to the pre-processors, so I won't be able to run them.

ComfyUI_TiledKSampler support slicing controlnets https://github.com/BlenderNeko/ComfyUI_TiledKSampler/blob/4fcc003f62efdbdec2f79eab37e1fb8dd84bac64/nodes.py#L255

That's already being done in this node. If I'm understanding the issue correctly, then the suggestion is that the preprocessors should be applied to each tile after they have been upscaled so there's more detail for the sampling. The only solution I can think of is making a new node that has the preprocessors hardcoded and toggleable with the node settings, so it won't be very flexible.

For now, probably the best way to do this is to make the image larger before passing it to the preprocessors. Hopefully the preprocessor will give better detail on the larger image. I don't know how the size of the image impacts the preprocessors, but ideally these two workflows are the same: [image -> resize -> preprocessor -> tile] is the same as [image -> tile -> resize -> preprocessor] where the latter is what happens in A1111, and the former is my suggestion.

ssitu avatar Feb 19 '24 17:02 ssitu

On second thought, I won't have access to the pre-processors, so I won't be able to run them.

ComfyUI_TiledKSampler support slicing controlnets https://github.com/BlenderNeko/ComfyUI_TiledKSampler/blob/4fcc003f62efdbdec2f79eab37e1fb8dd84bac64/nodes.py#L255

That's already being done in this node. If I'm understanding the issue correctly, then the suggestion is that the preprocessors should be applied to each tile after they have been upscaled so there's more detail for the sampling. The only solution I can think of is making a new node that has the preprocessors hardcoded and toggleable with the node settings, so it won't be very flexible.

For now, probably the best way to do this is to make the image larger before passing it to the preprocessors. Hopefully the preprocessor will give better detail on the larger image. I don't know how the size of the image impacts the preprocessors, but ideally these two workflows are the same: [image -> resize -> preprocessor -> tile] is the same as [image -> tile -> resize -> preprocessor] where the latter is what happens in A1111, and the former is my suggestion.

Looking forward to see the new node!

OliviaOliveiira avatar Feb 23 '24 15:02 OliviaOliveiira

@ssitu Man. Any news?

ZiBrianQian avatar Aug 30 '24 15:08 ZiBrianQian