Typos from the refactor

This commit is contained in:
cmdr2 2022-12-12 15:18:56 +05:30
parent 6b943f88d1
commit ac0961d7d4
3 changed files with 9 additions and 7 deletions

View File

@ -121,9 +121,9 @@ def resolve_model_paths(task_data: TaskData):
def set_vram_optimizations(context: Context, task_data: TaskData):
if task_data.turbo:
context.vram_optimizations += {'TURBO'}
context.vram_optimizations.add('TURBO')
else:
context.vram_optimizations -= {'TURBO'}
context.vram_optimizations.remove('TURBO')
def make_model_folders():
for model_type in KNOWN_MODEL_TYPES:

View File

@ -55,7 +55,7 @@ def make_images(req: GenerateImageRequest, task_data: TaskData, data_queue: queu
raise e
def _make_images_internal(req: GenerateImageRequest, task_data: TaskData, data_queue: queue.Queue, task_temp_images: list, step_callback):
images, user_stopped = generate_images(req, data_queue, task_temp_images, step_callback, task_data.stream_image_progress)
images, user_stopped = generate_images(req, task_data, data_queue, task_temp_images, step_callback, task_data.stream_image_progress)
filtered_images = apply_filters(task_data, images, user_stopped)
if task_data.save_to_disk_path is not None:
@ -64,10 +64,10 @@ def _make_images_internal(req: GenerateImageRequest, task_data: TaskData, data_q
return filtered_images if task_data.show_only_filtered_image else images + filtered_images
def generate_images(req: GenerateImageRequest, data_queue: queue.Queue, task_temp_images: list, step_callback, stream_image_progress: bool):
def generate_images(req: GenerateImageRequest, task_data: TaskData, data_queue: queue.Queue, task_temp_images: list, step_callback, stream_image_progress: bool):
context.temp_images.clear()
image_generator.on_image_step = make_step_callback(req, data_queue, task_temp_images, step_callback, stream_image_progress)
image_generator.on_image_step = make_step_callback(req, task_data, data_queue, task_temp_images, step_callback, stream_image_progress)
try:
images = image_generator.make_images(context=context, req=req)

View File

@ -40,12 +40,12 @@ class ServerStates:
class RenderTask(): # Task with output queue and completion lock.
def __init__(self, req: GenerateImageRequest, task_data: TaskData):
req.request_id = id(self)
task_data.request_id = id(self)
self.render_request: GenerateImageRequest = req # Initial Request
self.task_data: TaskData = task_data
self.response: Any = None # Copy of the last reponse
self.render_device = None # Select the task affinity. (Not used to change active devices).
self.temp_images:list = [None] * req.num_outputs * (1 if req.show_only_filtered_image else 2)
self.temp_images:list = [None] * req.num_outputs * (1 if task_data.show_only_filtered_image else 2)
self.error: Exception = None
self.lock: threading.Lock = threading.Lock() # Locks at task start and unlocks when task is completed
self.buffer_queue: queue.Queue = queue.Queue() # Queue of JSON string segments
@ -235,7 +235,9 @@ def thread_render(device):
'alive': True
}
current_state = ServerStates.LoadingModel
model_manager.load_default_models(renderer.context)
current_state = ServerStates.Online
while True: