feat: add tcd sampler and discrete distilled tcd scheduler based on sgm_uniform (same as lcm) (#2907)

This commit is contained in:
Manuel Schmid
2024-05-19 13:08:33 +02:00
committed by GitHub
parent 3bae73e23e
commit 2e2e8f851a
8 changed files with 65 additions and 13 deletions
+4 -4
View File
@@ -798,19 +798,19 @@ def worker():
final_sampler_name = sampler_name
final_scheduler_name = scheduler_name
if scheduler_name == 'lcm':
if scheduler_name in ['lcm', 'tcd']:
final_scheduler_name = 'sgm_uniform'
if pipeline.final_unet is not None:
pipeline.final_unet = core.opModelSamplingDiscrete.patch(
pipeline.final_unet,
sampling='lcm',
sampling=scheduler_name,
zsnr=False)[0]
if pipeline.final_refiner_unet is not None:
pipeline.final_refiner_unet = core.opModelSamplingDiscrete.patch(
pipeline.final_refiner_unet,
sampling='lcm',
sampling=scheduler_name,
zsnr=False)[0]
print('Using lcm scheduler.')
print(f'Using {scheduler_name} scheduler.')
async_task.yields.append(['preview', (13, 'Moving model to GPU ...', None)])