pormungtai commited on
Commit
c643614
·
verified ·
1 Parent(s): 2b217c0

Update app.py

Browse files

ปรับแก้พร้อมเป็นสองรูปแบบรองรับ NSFWและ และโค้ดGPT

Files changed (1) hide show
  1. app.py +31 -5
app.py CHANGED
@@ -1243,10 +1243,36 @@ with block:
1243
  height=320
1244
  )
1245
 
1246
- prompt = gr.Textbox(
1247
- label="プロンプト / Prompt",
1248
- value='The camera smoothly orbits around the center of the scene, keeping the center point fixed and always in view',
1249
- elem_id="prompt-input"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1250
  )
1251
 
1252
  example_quick_prompts = gr.Dataset(
@@ -1332,7 +1358,7 @@ with block:
1332
  error_message = gr.HTML('', elem_id='error-message', visible=True)
1333
 
1334
  # 処理関数
1335
- ips = [input_image, prompt, n_prompt, seed, total_second_length, use_teacache]
1336
 
1337
  # 開始と終了ボタンのイベント
1338
  start_button.click(fn=process, inputs=ips, outputs=[result_video, preview_image, progress_desc, progress_bar, start_button, end_button])
 
1243
  height=320
1244
  )
1245
 
1246
+ prompt_normal = gr.Textbox(
1247
+ label="🟢 Prompt ปกติ",
1248
+ placeholder="พิมพ์ prompt สุภาพ",
1249
+ lines=2
1250
+ )
1251
+
1252
+ prompt_nsfw = gr.Textbox(
1253
+ label="🔴 Prompt NSFW",
1254
+ placeholder="พิมพ์ prompt NSFW เต็มๆ ไม่เซ็นเซอร์",
1255
+ lines=2
1256
+ )
1257
+
1258
+ prompt_mode = gr.Radio(
1259
+ ["Normal", "NSFW"],
1260
+ label="เลือกโหมด / Mode",
1261
+ value="Normal"
1262
+ )
1263
+
1264
+ prompt_combined = gr.Textbox(
1265
+ label="📤 Prompt ที่ใช้จริง",
1266
+ visible=False
1267
+ )
1268
+
1269
+ combine_button = gr.Button("📤 ใช้ Prompt นี้")
1270
+ combine_button.click(
1271
+ fn=combine_prompt,
1272
+ inputs=[prompt_normal, prompt_nsfw, prompt_mode],
1273
+ outputs=prompt_combined
1274
+ )
1275
+
1276
  )
1277
 
1278
  example_quick_prompts = gr.Dataset(
 
1358
  error_message = gr.HTML('', elem_id='error-message', visible=True)
1359
 
1360
  # 処理関数
1361
+ ips = [input_image, prompt_combined, n_prompt, seed, total_second_length, use_teacache]
1362
 
1363
  # 開始と終了ボタンのイベント
1364
  start_button.click(fn=process, inputs=ips, outputs=[result_video, preview_image, progress_desc, progress_bar, start_button, end_button])