Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# 导入区域
|
2 |
import asyncio
|
3 |
import gc
|
4 |
import httpx
|
@@ -308,6 +307,7 @@ class ImageClient:
|
|
308 |
}
|
309 |
if config.is_lumina:
|
310 |
client_args = {}
|
|
|
311 |
if config.lumina_config.model_name:
|
312 |
client_args["ckpt_name"] = config.lumina_config.model_name
|
313 |
if config.lumina_config.cfg is not None:
|
@@ -428,7 +428,7 @@ class ImageClient:
|
|
428 |
payload = self._build_payload(config)
|
429 |
if DEBUG_MODE:
|
430 |
logger.debug(f"发送API请求到 {self.lumina_api_url}")
|
431 |
-
logger.
|
432 |
|
433 |
try:
|
434 |
response = await client.post(self.lumina_api_url, json=payload)
|
@@ -604,9 +604,8 @@ async def infer(
|
|
604 |
final_prompt = await polish_prompt(prompt_text)
|
605 |
|
606 |
# 为生成添加系统前缀,但不在UI显示
|
607 |
-
|
608 |
-
|
609 |
-
generation_prompt = f"{final_prompt}"
|
610 |
|
611 |
current_seed = int(seed_val)
|
612 |
if randomize_seed_val:
|
|
|
|
|
1 |
import asyncio
|
2 |
import gc
|
3 |
import httpx
|
|
|
307 |
}
|
308 |
if config.is_lumina:
|
309 |
client_args = {}
|
310 |
+
client_args["seed"] = config.seed
|
311 |
if config.lumina_config.model_name:
|
312 |
client_args["ckpt_name"] = config.lumina_config.model_name
|
313 |
if config.lumina_config.cfg is not None:
|
|
|
428 |
payload = self._build_payload(config)
|
429 |
if DEBUG_MODE:
|
430 |
logger.debug(f"发送API请求到 {self.lumina_api_url}")
|
431 |
+
logger.info(f"请求载荷: {payload}")
|
432 |
|
433 |
try:
|
434 |
response = await client.post(self.lumina_api_url, json=payload)
|
|
|
604 |
final_prompt = await polish_prompt(prompt_text)
|
605 |
|
606 |
# 为生成添加系统前缀,但不在UI显示
|
607 |
+
system_prefix = "You are an assistant designed to generate anime images with the highest degree of image-text alignment based on danbooru tags. <Prompt Start>"
|
608 |
+
generation_prompt = f"{system_prefix} {final_prompt}"
|
|
|
609 |
|
610 |
current_seed = int(seed_val)
|
611 |
if randomize_seed_val:
|