diff --git a/server.py b/server.py index b9fbd3a..2808921 100644 --- a/server.py +++ b/server.py @@ -370,9 +370,19 @@ async def ui_runs(): ''') - # Show input hash + # Show input if run.inputs: - html_parts.append(f'
Input: {run.inputs[0][:32]}...
') + input_hash = run.inputs[0] + html_parts.append(f'
Input: {input_hash[:32]}...
') + input_cache_path = CACHE_DIR / input_hash + if input_cache_path.exists(): + input_media_type = detect_media_type(input_cache_path) + html_parts.append('
') + if input_media_type == "video": + html_parts.append(f'') + elif input_media_type == "image": + html_parts.append(f'input') + html_parts.append('
') # Show output if completed if run.status == "completed" and run.output_hash: @@ -439,7 +449,17 @@ async def ui_run_detail(run_id: str): ''' if run.inputs: - html += f'
Input: {run.inputs[0][:32]}...
' + input_hash = run.inputs[0] + html += f'
Input: {input_hash[:32]}...
' + input_cache_path = CACHE_DIR / input_hash + if input_cache_path.exists(): + input_media_type = detect_media_type(input_cache_path) + html += '
' + if input_media_type == "video": + html += f'' + elif input_media_type == "image": + html += f'input' + html += '
' if run.status == "completed" and run.output_hash: cache_path = CACHE_DIR / run.output_hash