returnf"resize: from <span class='resolution'>{p.width}x{p.height}</span> to <span class='resolution'>{p.hr_resize_x or p.hr_upscale_to_x}x{p.hr_resize_y or p.hr_upscale_to_y}</span>"
defresize_from_to_html(width,height,scale_by):
target_width=int(width*scale_by)
target_height=int(height*scale_by)
ifnottarget_widthornottarget_height:
return"no image selected"
returnf"resize: from <span class='resolution'>{width}x{height}</span> to <span class='resolution'>{target_width}x{target_height}</span>"
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool="editor",image_mode="RGBA").style(height=480)