@@ -89,17 +89,18 @@ public String compose(MultipartFile roomImage, String furnitureImageUrl, String
8989 String version = "6d14f9b3d25a9400c4a5e5f0f6842ae7537fefcf68df86dad9533f66204f2bb2" ;
9090
9191 JSONObject input = new JSONObject ();
92- input . put ( "prompt" ,
93- "Place the object from input_image_1 (" + category + ") naturally into the room shown in input_image_2.\n "
94- + "- Maintain the original room lighting, shadows, and colors \n "
95- + "- Do NOT modify or remove any existing furniture or background in the room\n "
96- + "- Position the object realistically on the floor or against a wall, as appropriate for its type \n "
97- + "- Scale the object appropriately to match the real-world proportions of existing furniture and room structure \n "
98- + "- Match the object's perspective, angle, and orientation to the room\n "
99- + "- Apply soft and realistic shadows based on room lighting direction \n "
100- + "- Final result must be a photorealistic composite of input_image_2 with the object inserted \n "
101- + "- Do NOT include side-by-side or reference images, only the final composition"
92+ String prompt = String . format (
93+ "Place the object from input_image_1 (\" %s \ " ) naturally into the room shown in input_image_2.\n "
94+ + "- The object must be realistically positioned on the floor or against a wall, depending on its type \n "
95+ + "- Analyze existing furniture and architecture in the room to determine a suitable location and realistic scale \n "
96+ + "- Adjust the size of the object so it appears proportionate and consistent with surrounding furniture \n "
97+ + "- Align the perspective, angle, and orientation of the object to match the room’s camera view \n "
98+ + "- Maintain the original lighting and shadows of the room; cast soft and realistic shadows for the new object \n "
99+ + "- Do NOT remove or alter any existing furniture or decor \n "
100+ + "- Do NOT generate comparison or side-by-side images; only output a photorealistic single-frame result" ,
101+ category
102102 );
103+ input .put ("prompt" , prompt );
103104
104105 input .put ("input_image_1" , furnitureImageUrl );
105106 input .put ("input_image_2" , roomImageUrl );
0 commit comments