Skip to content

Commit

Permalink
Merge pull request #77 from rimgosu/main
Browse files Browse the repository at this point in the history
prompt
  • Loading branch information
rimgosu authored Feb 21, 2024
2 parents 3b4d320 + 4d6b2c1 commit a6e4e11
Showing 1 changed file with 41 additions and 17 deletions.
58 changes: 41 additions & 17 deletions app/services/image_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,61 @@
container_name = "greefile"
AZURE_ACCOUNT_KEY = os.getenv("AZURE_ACCOUNT_KEY")
connection_string = f'DefaultEndpointsProtocol=https;AccountName=greedotstorage;AccountKey={AZURE_ACCOUNT_KEY};EndpointSuffix=core.windows.net'

promptDict = {
1: """
please make cute
**normal**
please make cute This picture was painted by a child.
Please change this picture a little bit more cute.
I want to keep most of the original.
Arms and legs must be in the form of characters.
Please don't put your face and body in. I just wish I had one character.
And the parts other than the character outline must be a white background, so please make this important.
white background.
transparent png download,
--no background, shadow, surrounding friend, surrounding objects
--quality 0.5
""",
2: """
please make cool
This picture was painted by a child.
Please change this picture a little bit more cute.
I want to keep most of the original.
Arms and legs must be in the form of characters.
Please don't put your face and body in. I just wish I had one character.
And the parts other than the character outline must be a white background, so please make this important.
white background.
**sketch**
in the style of childs drawing,
transparent png download,
simple,
cute and colorful,
hd,
full body shot,
wearing shoes,
--no background, shadow, surrounding friend, surrounding objects
--quality 0.5
--stylize 50
""",
3: """
**anime**
anime,
transparent png download,
simple,
cute and colorful,
hd,
full body shot,
wearing shoes,
--no background, shadow, surrounding friend, surrounding objects
--quality 0.5
""",
4: """
**dizney**
Disney style,
3d animation,
transparent png download,
simple,
cute and colorful,
hd,
full body shot,
wearing shoes,
--no background, shadow, surrounding friend, surrounding objects
"""
}

async def create_image(promptSelect: int, raw_img_url: str) -> dict:
prompt = promptDict[promptSelect] + "\n" + raw_img_url
prompt += """
--no background, shadow, surrounding friend, surrounding objects
--quality 0.25
--stylize 50
"""
prompt = raw_img_url + ' '
prompt += promptDict[promptSelect]

headers = {
'Authorization': f'Bearer {MID_API_KEY}',
Expand Down

0 comments on commit a6e4e11

Please sign in to comment.