add Flux_ControlNet_Quantization

This commit is contained in:
tc2000731
2024-10-29 17:29:24 +08:00
parent 7e97a96840
commit 900a1c095f
7 changed files with 558 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ class MultiControlNetManager:
def to(self, device):
for model in self.models:
model.to(device)
for processor in self.processors:
processor.to(device)
def process_image(self, image, processor_id=None):
if processor_id is None:

View File

@@ -37,6 +37,11 @@ class Annotator:
self.processor_id = processor_id
self.detect_resolution = detect_resolution
def to(self,device):
if hasattr(self.processor,"model") and hasattr(self.processor.model,"to"):
self.processor.model.to(device)
def __call__(self, image, mask=None):
width, height = image.size