Sebastiankay commited on
Commit
1405ad0
1 Parent(s): 465449c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -37,7 +37,7 @@ custom_head = f"""
37
  <link rel="icon" type="image/x-icon" href="file=_res/assets/favicons/favicon.ico">
38
  <link rel="manifest" href="file=_res/assets/favicons/site.webmanifest">
39
  """
40
- # <link rel="stylesheet" href="{catppuccin_css}">
41
 
42
  theme = gr.themes.Soft(
43
  primary_hue="orange",
@@ -134,7 +134,7 @@ def process(Prompt, image_width, image_height, image_seed, randomize_seed):
134
  Prompt = groq_enhance_process("random prompt")
135
 
136
  used_seed = random.randint(0, MAX_SEED) if image_seed == 0 or randomize_seed else image_seed
137
- used_model = "turbo" if int(image_width) > 1024 or int(image_height) > 1024 else "flux" # turbo, flux
138
 
139
  timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
140
  filename_prompt = re.sub(r"[^\w\s-]", "", Prompt).strip().replace(" ", "_")
@@ -142,7 +142,7 @@ def process(Prompt, image_width, image_height, image_seed, randomize_seed):
142
  file_path = os.path.join(IMAGE_DIR, filename)
143
 
144
  encode_prompt = urllib.parse.quote(Prompt)
145
- request_url = f"https://image.pollinations.ai/prompt/{encode_prompt}?model={used_model}&width={image_width}&height={image_height}&nologo=true&enhance=false&nofeed=true&seed={used_seed}"
146
  print(request_url)
147
  response = requests.get(request_url)
148
  if response.status_code == 200:
 
37
  <link rel="icon" type="image/x-icon" href="file=_res/assets/favicons/favicon.ico">
38
  <link rel="manifest" href="file=_res/assets/favicons/site.webmanifest">
39
  """
40
+
41
 
42
  theme = gr.themes.Soft(
43
  primary_hue="orange",
 
134
  Prompt = groq_enhance_process("random prompt")
135
 
136
  used_seed = random.randint(0, MAX_SEED) if image_seed == 0 or randomize_seed else image_seed
137
+ # used_model = "turbo" if int(image_width) > 1024 or int(image_height) > 1024 else "flux" # turbo, flux
138
 
139
  timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
140
  filename_prompt = re.sub(r"[^\w\s-]", "", Prompt).strip().replace(" ", "_")
 
142
  file_path = os.path.join(IMAGE_DIR, filename)
143
 
144
  encode_prompt = urllib.parse.quote(Prompt)
145
+ request_url = f"https://image.pollinations.ai/prompt/{encode_prompt}?model=flux&width={image_width}&height={image_height}&nologo=true&enhance=false&nofeed=true&seed={used_seed}"
146
  print(request_url)
147
  response = requests.get(request_url)
148
  if response.status_code == 200: