0xZohar commited on
Commit
8a553ca
·
verified ·
1 Parent(s): f2a0d96

Fix: Gradio UI image display for text-to-LEGO generation

Browse files

Problem: Rendered LEGO images weren't showing after successful rendering
Root cause: Return value mismatch between unified_input_handler() and Gradio outputs

Changes:
- unified_input_handler() now returns 6 values (was 5)
- Added LDR text output as 5th return value
- Added rendered_image as 6th return value
- Updated Gradio output mapping to include render_result (Image component)

Affected functions:
- unified_input_handler(): Returns (renderings, part_list, status, ldr_data, ldr_text, rendered_image)
- process_ldr_file(): Returns (..., None, None) for file upload flow
- process_ldr_from_path(): Returns (..., None, None) for path-based flow

UI Flow:
1. User enters "red car" → CLIP retrieval → GPT generation → Blender render
2. Image now displays correctly in "Rendering Result" section
3. LDR text displays in "Generated LDR Content" textbox

This completes the text-to-LEGO visualization pipeline.

Files changed (1) hide show
  1. code/demo.py +1 -1
code/demo.py CHANGED
@@ -270,7 +270,7 @@ def unified_input_handler(file, text_query):
270
  print(f"✅ Found reference design: car_{car_id} (confidence: {confidence:.3f})")
271
 
272
  # Process the LDR design for GPT model (WITH numerical conversion)
273
- renderings, part_list, status, process_ldr_data, _ = process_ldr_from_path(
274
  ldr_path,
275
  process_for_model=True # Enable label mapping for GPT generation
276
  )
 
270
  print(f"✅ Found reference design: car_{car_id} (confidence: {confidence:.3f})")
271
 
272
  # Process the LDR design for GPT model (WITH numerical conversion)
273
+ renderings, part_list, status, process_ldr_data, _, _ = process_ldr_from_path(
274
  ldr_path,
275
  process_for_model=True # Enable label mapping for GPT generation
276
  )