Skip to content

Commit

Permalink
make task ids for API work without force_task_id
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Dec 17, 2023
1 parent 3d9a0d9 commit de03882
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,8 @@ def init_script_args(self, request, default_script_args, selectable_scripts, sel
return script_args

def text2imgapi(self, txt2imgreq: models.StableDiffusionTxt2ImgProcessingAPI):
task_id = create_task_id("text2img")
if txt2imgreq.force_task_id is None:
task_id = txt2imgreq.force_task_id
task_id = txt2imgreq.force_task_id or create_task_id("txt2img")

script_runner = scripts.scripts_txt2img
if not script_runner.scripts:
script_runner.initialize_scripts(False)
Expand Down Expand Up @@ -393,9 +392,7 @@ def text2imgapi(self, txt2imgreq: models.StableDiffusionTxt2ImgProcessingAPI):
return models.TextToImageResponse(images=b64images, parameters=vars(txt2imgreq), info=processed.js())

def img2imgapi(self, img2imgreq: models.StableDiffusionImg2ImgProcessingAPI):
task_id = create_task_id("img2img")
if img2imgreq.force_task_id is None:
task_id = img2imgreq.force_task_id
task_id = img2imgreq.force_task_id or create_task_id("img2img")

init_images = img2imgreq.init_images
if init_images is None:
Expand Down

0 comments on commit de03882

Please sign in to comment.