A method for controlling an image processing apparatus to generate a layout image, the method comprising: specifying one or a plurality of pieces of image data; generating, as first generating, a new template based on a feature of the specified one or plurality of pieces of image data, the generated new template including at least one or a plurality of slots to which the specified one or plurality of pieces of image data are laid out; and generating, as second generating, a layout image by laying out the specified one or plurality of pieces of image data to the one or plurality of slots included in the generated new template, characterized in that the method further comprises: accepting an editing operation of the generated layout image(s) from a user; after the layout image(s) is/are generated, displaying one or a plurality of templates usable to edit the generated layout image(s); and in a case where the editing operation accepted from the user is intended to change a template used for the generated layout image(s), changing the generated by using a template selected by the user from among the one or plurality of templates displayed, wherein a plurality of the new templates is generated based on the one or plurality of pieces of image data specified, wherein one or a plurality of templates other than the new template used to generate the layout image(s) from among the generated plurality of the new templates is included in the one or plurality of templates usable to edit the generated layout image(s), and wherein an aspect ratio(s) of the one or plurality of slots in the generated new template is specified based on the feature of the specified one or plurality of pieces of image data. specifying one or a plurality of pieces of image data; generating, as first generating, a new template based on a feature of the specified one or plurality of pieces of image data, the generated new template including at least one or a plurality of slots to which the specified one or plurality of pieces of image data are laid out; and generating, as second generating, a layout image by laying out the specified one or plurality of pieces of image data to the one or plurality of slots included in the generated new template, characterized in that the method further comprises: accepting an editing operation of the generated layout image(s) from a user; after the layout image(s) is/are generated, displaying one or a plurality of templates usable to edit the generated layout image(s); and in a case where the editing operation accepted from the user is intended to change a template used for the generated layout image(s), changing the generated by using a template selected by the user from among the one or plurality of templates displayed, wherein a plurality of the new templates is generated based on the one or plurality of pieces of image data specified, wherein one or a plurality of templates other than the new template used to generate the layout image(s) from among the generated plurality of the new templates is included in the one or plurality of templates usable to edit the generated layout image(s), and wherein an aspect ratio(s) of the one or plurality of slots in the generated new template is specified based on the feature of the specified one or plurality of pieces of image data. accepting an editing operation of the generated layout image(s) from a user; after the layout image(s) is/are generated, displaying one or a plurality of templates usable to edit the generated layout image(s); and in a case where the editing operation accepted from the user is intended to change a template used for the generated layout image(s), changing the generated by using a template selected by the user from among the one or plurality of templates displayed, wherein a plurality of the new templates is generated based on the one or plurality of pieces of image data specified, wherein one or a plurality of templates other than the new template used to generate the layout image(s) from among the generated plurality of the new templates is included in the one or plurality of templates usable to edit the generated layout image(s), and wherein an aspect ratio(s) of the one or plurality of slots in the generated new template is specified based on the feature of the specified one or plurality of pieces of image data.