an attempt to create token downsampling for sd-webui now allow factor to be lower than 1 so you can upsample instead of downsample borrowed code from dbolya and catboxanon and ethansmith2000