litellm doesnt support style_preset
This commit is contained in:
parent
be2e5eefb5
commit
57310b73a3
1 changed files with 1 additions and 8 deletions
|
|
@ -137,11 +137,6 @@ class Action:
|
||||||
if negmatch:
|
if negmatch:
|
||||||
negmatch_string = negmatch.group(1).strip()
|
negmatch_string = negmatch.group(1).strip()
|
||||||
|
|
||||||
# Regular expression to capture text after 'STYLE:' (if any)
|
|
||||||
stylematch = re.search(r"(?i)style:?\s*(.*)", prompt)
|
|
||||||
stylematch_string = None
|
|
||||||
if stylematch:
|
|
||||||
stylematch_string = negmatch.group(1).strip()
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"X-API-KEY": self.valves.LITELLM_API_KEY,
|
"X-API-KEY": self.valves.LITELLM_API_KEY,
|
||||||
|
|
@ -151,7 +146,6 @@ class Action:
|
||||||
if "sdxl" in modelchoice:
|
if "sdxl" in modelchoice:
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": str(prompt),
|
"prompt": str(prompt),
|
||||||
"style_preset": str(stylematch_string),
|
|
||||||
"cfg_scale": 7,
|
"cfg_scale": 7,
|
||||||
"height": 1024,
|
"height": 1024,
|
||||||
"width": 1024,
|
"width": 1024,
|
||||||
|
|
@ -167,8 +161,7 @@ class Action:
|
||||||
"mode": "text-to-image",
|
"mode": "text-to-image",
|
||||||
"model": str(modelchoice),
|
"model": str(modelchoice),
|
||||||
"aspect_ratio": "1:1",
|
"aspect_ratio": "1:1",
|
||||||
"response_format": "b64_json",
|
"response_format": "b64_json"
|
||||||
"style_preset": str(stylematch_string),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
payload.update(
|
payload.update(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue