Fix integration issues after the refactor

This commit is contained in:
cmdr2 2022-12-09 17:50:33 +05:30
parent dbac2655f5
commit f1de0be679
4 changed files with 10 additions and 5 deletions

View File

@ -393,7 +393,7 @@ call python --version
@if NOT DEFINED SD_UI_BIND_PORT set SD_UI_BIND_PORT=9000 @if NOT DEFINED SD_UI_BIND_PORT set SD_UI_BIND_PORT=9000
@if NOT DEFINED SD_UI_BIND_IP set SD_UI_BIND_IP=0.0.0.0 @if NOT DEFINED SD_UI_BIND_IP set SD_UI_BIND_IP=0.0.0.0
@uvicorn server:app --app-dir "%SD_UI_PATH%" --port %SD_UI_BIND_PORT% --host %SD_UI_BIND_IP% @uvicorn server:server_api --app-dir "%SD_UI_PATH%" --port %SD_UI_BIND_PORT% --host %SD_UI_BIND_IP%
@pause @pause

View File

@ -322,6 +322,6 @@ cd ..
export SD_UI_PATH=`pwd`/ui export SD_UI_PATH=`pwd`/ui
cd stable-diffusion cd stable-diffusion
uvicorn server:app --app-dir "$SD_UI_PATH" --port ${SD_UI_BIND_PORT:-9000} --host ${SD_UI_BIND_IP:-0.0.0.0} uvicorn server:server_api --app-dir "$SD_UI_PATH" --port ${SD_UI_BIND_PORT:-9000} --host ${SD_UI_BIND_IP:-0.0.0.0}
read -p "Press any key to continue" read -p "Press any key to continue"

View File

@ -101,7 +101,7 @@ def device_init(context, device):
context.device = device context.device = device
# Force full precision on 1660 and 1650 NVIDIA cards to avoid creating green images # Force full precision on 1660 and 1650 NVIDIA cards to avoid creating green images
if needs_to_force_full_precision(context.device_name): if needs_to_force_full_precision(context):
print(f'forcing full precision on this GPU, to avoid green images. GPU detected: {context.device_name}') print(f'forcing full precision on this GPU, to avoid green images. GPU detected: {context.device_name}')
# Apply force_full_precision now before models are loaded. # Apply force_full_precision now before models are loaded.
context.precision = 'full' context.precision = 'full'

View File

@ -83,7 +83,12 @@ def _make_images_internal(req: Request, data_queue: queue.Queue, task_temp_image
save_images(req, images) save_images(req, images)
return Response(req, images=construct_response(req, images)) res = Response(req, images=construct_response(req, images))
res = res.json()
data_queue.put(json.dumps(res))
print('Task completed')
return res
def generate_images(req: Request, data_queue: queue.Queue, task_temp_images: list, step_callback): def generate_images(req: Request, data_queue: queue.Queue, task_temp_images: list, step_callback):
thread_data.temp_images.clear() thread_data.temp_images.clear()
@ -91,7 +96,7 @@ def generate_images(req: Request, data_queue: queue.Queue, task_temp_images: lis
image_generator.on_image_step = make_step_callback(req, data_queue, task_temp_images, step_callback) image_generator.on_image_step = make_step_callback(req, data_queue, task_temp_images, step_callback)
try: try:
images = image_generator.make_image(context=thread_data, args=get_mk_img_args(req)) images = image_generator.make_images(context=thread_data, args=get_mk_img_args(req))
user_stopped = False user_stopped = False
except UserInitiatedStop: except UserInitiatedStop:
images = [] images = []