Skip to content

Commit

Permalink
Merge pull request #45 from zuencap/main
Browse files Browse the repository at this point in the history
Make api.py python 3.9 compatible
  • Loading branch information
zero01101 authored Mar 23, 2023
2 parents 6e7a7e1 + df08f44 commit 46534e8
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions scripts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,13 @@ async def return_model_unet_channel_count(
}

def switchAssumption(channelCount):
match channelCount:
case 4:
return "traditional"
case 5:
return "sdv2 depth2img"
case 7:
return "sdv2 upscale 4x"
case 8:
return "instruct-pix2pix"
case 9:
return "inpainting"
case _:
return "¯\_(ツ)_/¯"
return {
4: "traditional",
5: "sdv2 depth2img",
7: "sdv2 upscale 4x",
8: "instruct-pix2pix",
9: "inpainting"
}.get(channelCount, "¯\_(ツ)_/¯")

def get_current_model():
options = {}
Expand All @@ -67,4 +61,4 @@ def get_current_model():
except:
print("[openOutpaint-webui-extension] UNET API failed to initialize")



0 comments on commit 46534e8

Please sign in to comment.