Use DPM++ scheduler when IP-Adapter disabled
DPMSolverMultistepScheduler produces sharper, higher quality output. This matches the original dreamtail configuration that produced excellent results.
This commit is contained in:
@@ -11,7 +11,7 @@ import cv2
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from typing import Optional, Dict, Any, List, Union
|
from typing import Optional, Dict, Any, List, Union
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from diffusers import StableDiffusionXLPipeline, DDIMScheduler
|
from diffusers import StableDiffusionXLPipeline, DDIMScheduler, DPMSolverMultistepScheduler
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class SDXLGenerator:
|
|||||||
add_watermarker=False,
|
add_watermarker=False,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# Use model's default scheduler for best quality
|
# Use model's default scheduler, then switch to DPM++ for best quality
|
||||||
self.pipeline = StableDiffusionXLPipeline.from_pretrained(
|
self.pipeline = StableDiffusionXLPipeline.from_pretrained(
|
||||||
config.SDXL_MODEL_ID,
|
config.SDXL_MODEL_ID,
|
||||||
torch_dtype=dtype,
|
torch_dtype=dtype,
|
||||||
@@ -91,6 +91,11 @@ class SDXLGenerator:
|
|||||||
cache_dir=str(config.MODELS_DIR),
|
cache_dir=str(config.MODELS_DIR),
|
||||||
add_watermarker=False,
|
add_watermarker=False,
|
||||||
)
|
)
|
||||||
|
# Use DPM++ scheduler for better quality/speed
|
||||||
|
self.pipeline.scheduler = DPMSolverMultistepScheduler.from_config(
|
||||||
|
self.pipeline.scheduler.config
|
||||||
|
)
|
||||||
|
logger.info("Using DPM++ scheduler for best quality")
|
||||||
|
|
||||||
# Move to device
|
# Move to device
|
||||||
self.pipeline = self.pipeline.to(self.device)
|
self.pipeline = self.pipeline.to(self.device)
|
||||||
|
|||||||
Reference in New Issue
Block a user