StreamDiffusion icon indicating copy to clipboard operation
StreamDiffusion copied to clipboard

example/screen/main.py can't get the same Performance like demo shown

Open chongxian opened this issue 1 year ago • 4 comments

I modify the prompt to"waves,sea",and I use the same input as the demo,but I can't get the same Performance like your demo shown.could you kind to teach me how to solve this problem? image

chongxian avatar Dec 22 '23 08:12 chongxian

For drawing purposes, you can set do_add_noise = True (It is False by default for this demo)

You can also set t_index_list=[18,26,35,45]. This list indicates the noise scheduler. (The length of the list denotes the number of denoising steps).

Setting the starting point of the list closer to 0 results in more varied generation outcomes, while setting it closer to 49 yields results that are more aligned to the input image. Additionally, increasing the number of elements in the list improves the quality of the results that are generated. Therefore, for drawing purposes, using a list starting around 20 with a length of 4 tends to produce good results. Feel free to adjust the numbers in the list. However, please ensure that the numbers are in ascending order and within the range of 0 to 49.

cumulo-autumn avatar Dec 22 '23 08:12 cumulo-autumn

The default acceleration set to xformers. You will get faster speeds with tensorrt I guess.

Jannchie avatar Dec 24 '23 04:12 Jannchie

@cumulo-autumn Why the image returned is based on length of t_index_list.

e.g. when t_index_list=[18,26]

out_1 = stream(image_1)
out_2 = stream(image_2)
out_3 = stream(image_3)

out_2 will actually have output from image_1 and out_3 will have output of image_2 and so on.

if t_index_list=[18,26,35,45] then out_4 will contain the output from image_1

EDIT: With more fiddling, I have realized that this lag/gap between input and output does not really depend on t_index_list but something else. It keeps increasing even if t_index_list length was just 2.

SMUsamaShah avatar Dec 28 '23 01:12 SMUsamaShah

I'm also unable to get such high fps as shown in the example gif. Switched to TensorRT Using various t_index lengths Using RTX 3090, Ryzen 7 5800X

Getting about 10-11 FPS.

edit After switching to sd-turbo I was able to almost match the speed from the gif.

model_id_or_path: str = "stabilityai/sd-turbo"

That really should be the default.

Reducing the number of step indexes also helps, as well as reducing the complexity of the prompt.

mflux avatar Apr 02 '24 17:04 mflux