Add ENABLE_IP_ADAPTER config flag (default: False)
Allows disabling IP-Adapter FaceID entirely for cleaner output quality. Set to True in config.py to re-enable face-locked generation.
This commit is contained in:
@@ -29,6 +29,7 @@ SDXL_REFINER_ID = "stabilityai/stable-diffusion-xl-refiner-1.0"
|
|||||||
USE_REFINER = False # Set to True to enable refiner (requires more VRAM)
|
USE_REFINER = False # Set to True to enable refiner (requires more VRAM)
|
||||||
|
|
||||||
# IP-Adapter FaceID settings
|
# IP-Adapter FaceID settings
|
||||||
|
ENABLE_IP_ADAPTER = False # Set to True to enable face-locked generation
|
||||||
IP_ADAPTER_DIR = Path(os.getenv("DREAMTAIL_IP_ADAPTER", MODELS_DIR / "ip-adapter"))
|
IP_ADAPTER_DIR = Path(os.getenv("DREAMTAIL_IP_ADAPTER", MODELS_DIR / "ip-adapter"))
|
||||||
IP_ADAPTER_PATH = IP_ADAPTER_DIR / "ip-adapter-faceid_sdxl.bin"
|
IP_ADAPTER_PATH = IP_ADAPTER_DIR / "ip-adapter-faceid_sdxl.bin"
|
||||||
FACE_REFERENCE_DIR = STORAGE_DIR / "faces" # Directory for face reference images
|
FACE_REFERENCE_DIR = STORAGE_DIR / "faces" # Directory for face reference images
|
||||||
|
|||||||
@@ -244,7 +244,10 @@ class SDXLGenerator:
|
|||||||
logger.info(f"Parameters: {width}x{height}, steps={num_inference_steps}, guidance={guidance_scale}")
|
logger.info(f"Parameters: {width}x{height}, steps={num_inference_steps}, guidance={guidance_scale}")
|
||||||
|
|
||||||
# Check if face-locked generation requested
|
# Check if face-locked generation requested
|
||||||
use_face_id = face_image is not None
|
use_face_id = face_image is not None and config.ENABLE_IP_ADAPTER
|
||||||
|
|
||||||
|
if face_image is not None and not config.ENABLE_IP_ADAPTER:
|
||||||
|
logger.info("IP-Adapter disabled in config, generating without face lock")
|
||||||
|
|
||||||
if use_face_id:
|
if use_face_id:
|
||||||
# Initialize IP-Adapter if needed
|
# Initialize IP-Adapter if needed
|
||||||
|
|||||||
Reference in New Issue
Block a user