From 6f114b61c702ff96315c7eea9df12a56c00b514b Mon Sep 17 00:00:00 2001 From: puke <1129090915@qq.com> Date: Mon, 3 Nov 2025 16:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E5=9B=BE=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app.py | 42 ++++++++++++++++++++++++++++++------- web/i18n/locales/en_US.json | 8 +++++++ web/i18n/locales/zh_CN.json | 8 +++++++ 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/web/app.py b/web/app.py index 75132b4..3599173 100644 --- a/web/app.py +++ b/web/app.py @@ -548,6 +548,8 @@ def main(): st.markdown(tr("style.workflow_what")) st.markdown(f"**{tr('help.how')}**") st.markdown(tr("style.workflow_how")) + st.markdown(f"**{tr('help.note')}**") + st.markdown(tr("style.image_size_note")) # Get available workflows from pixelle_video (with source info) workflows = pixelle_video.image.list_workflows() @@ -583,19 +585,38 @@ def main(): workflow_key = "runninghub/image_flux.json" # fallback - # 2. Prompt prefix input - st.markdown(f"**{tr('style.prompt_prefix')}**") + # 2. Image size input + col1, col2 = st.columns(2) + with col1: + image_width = st.number_input( + tr('style.image_width'), + min_value=128, + value=1024, + step=1, + label_visibility="visible", + help=tr('style.image_width_help') + ) + with col2: + image_height = st.number_input( + tr('style.image_height'), + min_value=128, + value=1024, + step=1, + label_visibility="visible", + help=tr('style.image_height_help') + ) + # 3. Prompt prefix input # Get current prompt_prefix from config current_prefix = comfyui_config["image"]["prompt_prefix"] # Prompt prefix input (temporary, not saved to config) prompt_prefix = st.text_area( - "Prompt Prefix", + tr('style.prompt_prefix'), value=current_prefix, placeholder=tr("style.prompt_prefix_placeholder"), height=80, - label_visibility="collapsed", + label_visibility="visible", help=tr("style.prompt_prefix_help") ) @@ -618,12 +639,12 @@ def main(): # Build final prompt with prefix final_prompt = build_image_prompt(test_prompt, prompt_prefix) - # Generate preview image (small size for speed) + # Generate preview image (use user-specified size) preview_image_path = run_async(pixelle_video.image( prompt=final_prompt, workflow=workflow_key, - width=512, - height=512 + width=int(image_width), + height=int(image_height) )) # Display preview (support both URL and local path) @@ -734,6 +755,11 @@ def main(): # Get full template path frame_template = template_path_map.get(selected_display_name) + # Display video size from template + from pixelle_video.utils.template_util import parse_template_size + video_width, video_height = parse_template_size(frame_template) + st.caption(tr("template.video_size_info", width=video_width, height=video_height)) + # Template preview expander with st.expander(tr("template.preview_title"), expanded=False): col1, col2 = st.columns(2) @@ -867,6 +893,8 @@ def main(): "n_scenes": n_scenes, "tts_workflow": tts_workflow_key, "image_workflow": workflow_key, + "image_width": int(image_width), + "image_height": int(image_height), "frame_template": frame_template, "prompt_prefix": prompt_prefix, "bgm_path": bgm_path, diff --git a/web/i18n/locales/en_US.json b/web/i18n/locales/en_US.json index c97a50c..f414930 100644 --- a/web/i18n/locales/en_US.json +++ b/web/i18n/locales/en_US.json @@ -45,6 +45,12 @@ "style.workflow": "Workflow Selection", "style.workflow_what": "Determines how each frame's illustration is generated and its effect (e.g., using FLUX, SD models)", "style.workflow_how": "Place image_xxx.json workflow files in workflows/selfhost/ (local ComfyUI) or workflows/runninghub/ (cloud) folder", + "style.image_size": "Image Size", + "style.image_width": "Width", + "style.image_height": "Height", + "style.image_width_help": "Width of AI-generated images (Note: This is the image size, not the final video size. Video size is determined by the template)", + "style.image_height_help": "Height of AI-generated images (Note: This is the image size, not the final video size. Video size is determined by the template)", + "style.image_size_note": "Image size controls the dimensions of AI-generated illustrations, and does not affect the final video size. Video size is determined by the Storyboard Template below.", "style.prompt_prefix": "Prompt Prefix", "style.prompt_prefix_what": "Automatically added before all image prompts to control the illustration style uniformly (e.g., cartoon, realistic)", "style.prompt_prefix_how": "Enter style description in the input box below. To save permanently, edit the config.yaml file", @@ -68,6 +74,7 @@ "template.selector": "Template Selection", "template.select": "Select Template", "template.select_help": "Select template and video size", + "template.video_size_info": "Final Video Size: {width} × {height}", "template.separator_selected": "Please select a specific template, not the group header", "template.default": "Default", "template.modern": "Modern", @@ -198,6 +205,7 @@ "help.feature_description": "💡 Feature Description", "help.what": "Purpose", "help.how": "Customization", + "help.note": "Note", "language.select": "🌐 Language" } diff --git a/web/i18n/locales/zh_CN.json b/web/i18n/locales/zh_CN.json index cf81087..3617316 100644 --- a/web/i18n/locales/zh_CN.json +++ b/web/i18n/locales/zh_CN.json @@ -45,6 +45,12 @@ "style.workflow": "工作流选择", "style.workflow_what": "决定视频中每帧插图的生成方式和效果(如使用 FLUX、SD 等模型)", "style.workflow_how": "将 image_xxx.json 工作流文件放入 workflows/selfhost/(本地 ComfyUI)或 workflows/runninghub/(云端)文件夹", + "style.image_size": "图片尺寸", + "style.image_width": "宽度", + "style.image_height": "高度", + "style.image_width_help": "AI 生成插图的宽度(注意:这是插图尺寸,不是最终视频尺寸。视频尺寸由模板决定)", + "style.image_height_help": "AI 生成插图的高度(注意:这是插图尺寸,不是最终视频尺寸。视频尺寸由模板决定)", + "style.image_size_note": "图片尺寸控制 AI 生成的插图大小,不影响最终视频尺寸。视频尺寸由下方的「📐 分镜模板」决定。", "style.prompt_prefix": "提示词前缀", "style.prompt_prefix_what": "自动添加到所有图片提示词前面,统一控制插图风格(如:卡通风格、写实风格等)", "style.prompt_prefix_how": "直接在下方输入框填写风格描述。若要永久保存,需编辑 config.yaml 文件", @@ -68,6 +74,7 @@ "template.selector": "模板选择", "template.select": "选择模板", "template.select_help": "选择模板和视频尺寸", + "template.video_size_info": "最终视频尺寸:{width} × {height}", "template.separator_selected": "请选择具体的模板,而不是分组标题", "template.default": "默认", "template.modern": "现代", @@ -198,6 +205,7 @@ "help.feature_description": "💡 功能说明", "help.what": "作用", "help.how": "自定义方式", + "help.note": "注意", "language.select": "🌐 语言" }