{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "collapsed_sections": [ "U2ceFGsQ4kr1", "TaDWZVq544Yg", "ROp80eLX7HVu", "SZqVpF00-spJ" ], "gpuType": "T4" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "accelerator": "GPU", "widgets": { "application/vnd.jupyter.widget-state+json": { "783ff8644e7a4776a89adad3f133ad15": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_1a23dfd9029742c1bba8f3844b82ad7e", "IPY_MODEL_2efd3cf426cc4bc3b77c43e52a30a4c2", "IPY_MODEL_df78debc83ee4495a74c201d36297c17" ], "layout": "IPY_MODEL_c7bf11c382d64154b006f2c14cbdf734" } }, "1a23dfd9029742c1bba8f3844b82ad7e": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_e91319d9aad64a15949a0ed5b9e8a449", "placeholder": "​", "style": "IPY_MODEL_ce5592b51f7d4a2f8a3c5d7e6f67fea6", "value": "model_index.json: 100%" } }, "2efd3cf426cc4bc3b77c43e52a30a4c2": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6edfae7380c9442fa21e352b11cb1622", "max": 509, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_012e398323914b46bcc5c6e95bbfab69", "value": 509 } }, "df78debc83ee4495a74c201d36297c17": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_1e83168ff3ea456daf06f4a74dc867d7", "placeholder": "​", "style": "IPY_MODEL_687d8fbade8040d989b505d7784f7a92", "value": " 509/509 [00:00<00:00, 24.9kB/s]" } }, "c7bf11c382d64154b006f2c14cbdf734": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e91319d9aad64a15949a0ed5b9e8a449": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "ce5592b51f7d4a2f8a3c5d7e6f67fea6": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "6edfae7380c9442fa21e352b11cb1622": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "012e398323914b46bcc5c6e95bbfab69": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "1e83168ff3ea456daf06f4a74dc867d7": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "687d8fbade8040d989b505d7784f7a92": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "3a92de15b8434fb783eeaf1c5f967f28": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_3d18b76947604ea79e00b82c18f42c04", "IPY_MODEL_846aacb95e6543e3a4b8defe36485e42", "IPY_MODEL_3f37021ef6d14ee28cf5d076b847e815" ], "layout": "IPY_MODEL_ac15ee7b63b2418fa955993b02aed6a9" } }, "3d18b76947604ea79e00b82c18f42c04": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ef0b7048b0dc4292ba7082d46378ba4f", "placeholder": "​", "style": "IPY_MODEL_b74f3e3a2e7e43b79671736886e79a34", "value": "Download complete: " } }, "846aacb95e6543e3a4b8defe36485e42": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c4e3b47e546c4a3aba51c8cc3adf7e5d", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_39cde5e0fd0d439ab61292b8d17ef2f7", "value": 1 } }, "3f37021ef6d14ee28cf5d076b847e815": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_319d1db8f8314fdaaa1dd8fe55346877", "placeholder": "​", "style": "IPY_MODEL_60b86a00863242448271790e309c7645", "value": " 5.92G/? [01:08<00:00, 80.5MB/s]" } }, "ac15ee7b63b2418fa955993b02aed6a9": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "ef0b7048b0dc4292ba7082d46378ba4f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b74f3e3a2e7e43b79671736886e79a34": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "c4e3b47e546c4a3aba51c8cc3adf7e5d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "39cde5e0fd0d439ab61292b8d17ef2f7": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "319d1db8f8314fdaaa1dd8fe55346877": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "60b86a00863242448271790e309c7645": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "3b23e1a5c5bf47b9bb2cda06e710d691": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_d7af6a4376e14c2d9583f5100da01cf3", "IPY_MODEL_5a82cd5199c94eb7947210629d9b2f31", "IPY_MODEL_0ff20ef4403e431a85ec89a41625a675" ], "layout": "IPY_MODEL_59e362cecb7349eebedfe125b23c7059" } }, "d7af6a4376e14c2d9583f5100da01cf3": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_445a58dbaf0f4fc09bc06f1977fafede", "placeholder": "​", "style": "IPY_MODEL_841a6273102b44ba868a585a09041928", "value": "Fetching 11 files: 100%" } }, "5a82cd5199c94eb7947210629d9b2f31": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_670e4810a68d4fa1b3a8e159faa9137b", "max": 11, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_fe003d2b973648628808c95d5743eeee", "value": 11 } }, "0ff20ef4403e431a85ec89a41625a675": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_44e921dd0a774986aa9d705294fa9df0", "placeholder": "​", "style": "IPY_MODEL_e0950863f17d4064b086945e0d19482e", "value": " 11/11 [01:08<00:00, 19.99s/it]" } }, "59e362cecb7349eebedfe125b23c7059": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "445a58dbaf0f4fc09bc06f1977fafede": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "841a6273102b44ba868a585a09041928": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "670e4810a68d4fa1b3a8e159faa9137b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "fe003d2b973648628808c95d5743eeee": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "44e921dd0a774986aa9d705294fa9df0": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e0950863f17d4064b086945e0d19482e": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "fbde0c0d7514430784f2a520ca0d332d": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_f01882ed721f4ed994138ac051dffdd8", "IPY_MODEL_9bf6619f6a36422988ab64eb32d6d40f", "IPY_MODEL_0d5004160b4d44c89ff7812e5901317f" ], "layout": "IPY_MODEL_6727260a07db41498618c8f30734eab2" } }, "f01882ed721f4ed994138ac051dffdd8": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_d234cc8e7cd848cb9d246ddfd245106b", "placeholder": "​", "style": "IPY_MODEL_5ea6a23fe3504eb1a8114d0f870c84a2", "value": "Loading pipeline components...: 100%" } }, "9bf6619f6a36422988ab64eb32d6d40f": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c9eaf147884048d5ad8fc11d04a99cd4", "max": 5, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_67f0d56fcc1c44fd970250983f72a798", "value": 5 } }, "0d5004160b4d44c89ff7812e5901317f": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c2073beddd1d4668a19f7d4e5af40c41", "placeholder": "​", "style": "IPY_MODEL_a8689907941b46cf9b3fe3b8baca4cff", "value": " 5/5 [00:16<00:00,  2.68s/it]" } }, "6727260a07db41498618c8f30734eab2": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d234cc8e7cd848cb9d246ddfd245106b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "5ea6a23fe3504eb1a8114d0f870c84a2": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "c9eaf147884048d5ad8fc11d04a99cd4": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "67f0d56fcc1c44fd970250983f72a798": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "c2073beddd1d4668a19f7d4e5af40c41": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a8689907941b46cf9b3fe3b8baca4cff": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "1fb25a944ce74731ac98f3d19726ac71": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_63d9fd2246f0401bac4a9403e432890a", "IPY_MODEL_a19a70de4b64454783e45af4155d2946", "IPY_MODEL_d8d86e92d06347e9b3703a55552d413a" ], "layout": "IPY_MODEL_287e02129f2f4c188ebb0d599525d0a3" } }, "63d9fd2246f0401bac4a9403e432890a": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_189941b83278489392fa50b6b11633d5", "placeholder": "​", "style": "IPY_MODEL_dcaa2683f0354d7fbc96aaf212533c14", "value": "Loading weights: 100%" } }, "a19a70de4b64454783e45af4155d2946": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_b99941b078c040f68b858731cbbb1bbc", "max": 901, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_d0c6d95be53d4fe8b4ddac0fc228d663", "value": 901 } }, "d8d86e92d06347e9b3703a55552d413a": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_420644023b9544c8aa25816503ae130a", "placeholder": "​", "style": "IPY_MODEL_e0ec645c2d074faba7412282599bb56c", "value": " 901/901 [00:02<00:00, 745.20it/s, Materializing param=model.norm.weight]" } }, "287e02129f2f4c188ebb0d599525d0a3": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "189941b83278489392fa50b6b11633d5": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "dcaa2683f0354d7fbc96aaf212533c14": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "b99941b078c040f68b858731cbbb1bbc": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d0c6d95be53d4fe8b4ddac0fc228d663": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "420644023b9544c8aa25816503ae130a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e0ec645c2d074faba7412282599bb56c": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "5cd0b7c7360844a48b0a37f3022a83a5": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_26cf59b88fb34fa294e6a45bcbc673ca", "IPY_MODEL_cfbe83782a084fb7afc21b4ae7920b07", "IPY_MODEL_7c3177ba3aa346d4abb96327596f748c" ], "layout": "IPY_MODEL_1ce1cdda084442fcb6c5fd6ee6be7c51" } }, "26cf59b88fb34fa294e6a45bcbc673ca": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_669bc567664c4bd5a3dea58cfd81d9fa", "placeholder": "​", "style": "IPY_MODEL_55b725d64e654026b5106cf3278e85da", "value": "model_index.json: 100%" } }, "cfbe83782a084fb7afc21b4ae7920b07": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_f0273bcda4754e419f9bf779f0082e0c", "max": 446, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_bf762f92d95c428782bf3675d02e03a2", "value": 446 } }, "7c3177ba3aa346d4abb96327596f748c": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_70dacf10530848808ede991691e54d42", "placeholder": "​", "style": "IPY_MODEL_b433d5fa9c854edfa5ac9a88d9724b78", "value": " 446/446 [00:00<00:00, 12.9kB/s]" } }, "1ce1cdda084442fcb6c5fd6ee6be7c51": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "669bc567664c4bd5a3dea58cfd81d9fa": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "55b725d64e654026b5106cf3278e85da": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "f0273bcda4754e419f9bf779f0082e0c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "bf762f92d95c428782bf3675d02e03a2": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "70dacf10530848808ede991691e54d42": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b433d5fa9c854edfa5ac9a88d9724b78": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "645242cb2c0346debdd5cb3f9757846e": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_9a9a5f163725456bb96dab66d51993a5", "IPY_MODEL_6055aa92eca247989338499f6eac4d4e", "IPY_MODEL_4e700e4e79e54e3388d3b675678e463e" ], "layout": "IPY_MODEL_41163413d8394689897553b3b1bcbc43" } }, "9a9a5f163725456bb96dab66d51993a5": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a60ea328a62d4e649bc032edf5487c3b", "placeholder": "​", "style": "IPY_MODEL_cfdf654941564c37b1f9a6780ea06a01", "value": "Download complete: " } }, "6055aa92eca247989338499f6eac4d4e": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c8c4cfc3984d4b0fb27cab65435fceee", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_407ed893b728422ea4ea56d954e8187f", "value": 1 } }, "4e700e4e79e54e3388d3b675678e463e": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_97c2a763a58d43cd851f45761ab0b4d6", "placeholder": "​", "style": "IPY_MODEL_7ed5dcf50b2c4bf1b71b1d24dd953836", "value": " 16.0G/? [04:12<00:00, 56.6MB/s]" } }, "41163413d8394689897553b3b1bcbc43": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a60ea328a62d4e649bc032edf5487c3b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "cfdf654941564c37b1f9a6780ea06a01": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "c8c4cfc3984d4b0fb27cab65435fceee": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "407ed893b728422ea4ea56d954e8187f": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "97c2a763a58d43cd851f45761ab0b4d6": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "7ed5dcf50b2c4bf1b71b1d24dd953836": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "faecce3bbfcd49988c75caf43b0cbd81": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_8ce9979203c942bea55b88a6f877f39e", "IPY_MODEL_589542b1baaa44ac8e56a204a8b0fecc", "IPY_MODEL_a4d4197181564d10bd872f5989daf9c2" ], "layout": "IPY_MODEL_9f0c6557ee074162925c408ab6471c7e" } }, "8ce9979203c942bea55b88a6f877f39e": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_f78b370ed72340e499648f335bca6e0c", "placeholder": "​", "style": "IPY_MODEL_af4dc40e215e4ad092fb9e47a67fdeaa", "value": "Fetching 17 files: 100%" } }, "589542b1baaa44ac8e56a204a8b0fecc": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_080d6e7b8a0c48a08b10e359db933118", "max": 17, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_79a4c316ae8c49a5a403270c0ed7528d", "value": 17 } }, "a4d4197181564d10bd872f5989daf9c2": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3a17f3869be04c7cb4fe990eea2c6475", "placeholder": "​", "style": "IPY_MODEL_140b2e2a108b45379a1db638b64a51b2", "value": " 17/17 [04:09<00:00, 14.45s/it]" } }, "9f0c6557ee074162925c408ab6471c7e": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "f78b370ed72340e499648f335bca6e0c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "af4dc40e215e4ad092fb9e47a67fdeaa": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "080d6e7b8a0c48a08b10e359db933118": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "79a4c316ae8c49a5a403270c0ed7528d": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "3a17f3869be04c7cb4fe990eea2c6475": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "140b2e2a108b45379a1db638b64a51b2": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "365a52948ab140fb81e6add9236bdf6e": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_782fcdbae1ce47d28ea73b6f24672c1b", "IPY_MODEL_a7eda2144cab474c83dce5c09ef42808", "IPY_MODEL_b1c4919fdeab478dac27a0d1b9747827" ], "layout": "IPY_MODEL_1e6ffe85d0524d97a8b3fb42e1154925" } }, "782fcdbae1ce47d28ea73b6f24672c1b": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_06bde21738ff4e829de6140054a20218", "placeholder": "​", "style": "IPY_MODEL_c89479b4e34e4d698297920bc00edbd6", "value": "Loading pipeline components...: 100%" } }, "a7eda2144cab474c83dce5c09ef42808": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_757d43ad58134b20b8fd48d4a6bef837", "max": 5, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_cae9dd7921264a4486143063ef9752f7", "value": 5 } }, "b1c4919fdeab478dac27a0d1b9747827": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c4929018c94f425ca9812b0fbc22f575", "placeholder": "​", "style": "IPY_MODEL_5e056cf647e64f48a291ada445a8605e", "value": " 5/5 [00:03<00:00,  1.10it/s]" } }, "1e6ffe85d0524d97a8b3fb42e1154925": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "06bde21738ff4e829de6140054a20218": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c89479b4e34e4d698297920bc00edbd6": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "757d43ad58134b20b8fd48d4a6bef837": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "cae9dd7921264a4486143063ef9752f7": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "c4929018c94f425ca9812b0fbc22f575": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "5e056cf647e64f48a291ada445a8605e": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "ba7f2317997343a888bf6797cd9eb61e": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_5c5552563aae4fc3828cd821663225fc", "IPY_MODEL_c33ff64e667d4012b1ddb119b74c6f64", "IPY_MODEL_8ae0fc94dcc040d9b74c4b6c79612cff" ], "layout": "IPY_MODEL_6660e8b248d44b99817d40d6caae53c9" } }, "5c5552563aae4fc3828cd821663225fc": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_84a3579190a642b4a1655e2ad34e0a9a", "placeholder": "​", "style": "IPY_MODEL_c58eeff99c804bd4bc3d72ef52b821a2", "value": "Loading weights: 100%" } }, "c33ff64e667d4012b1ddb119b74c6f64": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_90a88d46b53a4a13a3d61a0ab4a3896d", "max": 398, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1531841b8dad4f39b5c2673b9d12fcb6", "value": 398 } }, "8ae0fc94dcc040d9b74c4b6c79612cff": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_bb45c9e1fe674f18812fb174666a007f", "placeholder": "​", "style": "IPY_MODEL_acb34b7dd9bb48a8aa08e5271f832ae5", "value": " 398/398 [00:01<00:00, 288.55it/s, Materializing param=model.norm.weight]" } }, "6660e8b248d44b99817d40d6caae53c9": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "84a3579190a642b4a1655e2ad34e0a9a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c58eeff99c804bd4bc3d72ef52b821a2": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "90a88d46b53a4a13a3d61a0ab4a3896d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "1531841b8dad4f39b5c2673b9d12fcb6": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "bb45c9e1fe674f18812fb174666a007f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "acb34b7dd9bb48a8aa08e5271f832ae5": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "73791b3a6377440ab767df501170c41b": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_081098c183514522a6e98c776412d901", "IPY_MODEL_f17fb5596fb741e09f433613130a643d", "IPY_MODEL_499da4e9407f4bdd92aa8ab9368e26b6" ], "layout": "IPY_MODEL_2192c317c7934bc8afc0027d7227e64d" } }, "081098c183514522a6e98c776412d901": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a18063a1cc5f401a974ebf038df4925e", "placeholder": "​", "style": "IPY_MODEL_6dca81acdc774b39a3b4eaf6a9bbdeb2", "value": "model_index.json: 100%" } }, "f17fb5596fb741e09f433613130a643d": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_7a94ff46576d4f6fb080389a38b4f5e5", "max": 446, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_9e036487e6424a4f8efc5f44066d9b47", "value": 446 } }, "499da4e9407f4bdd92aa8ab9368e26b6": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_0f359906152840c3a3dabd7a02e41c07", "placeholder": "​", "style": "IPY_MODEL_ab84c059d8b24f11a1045337f69776a1", "value": " 446/446 [00:00<00:00, 18.5kB/s]" } }, "2192c317c7934bc8afc0027d7227e64d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a18063a1cc5f401a974ebf038df4925e": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6dca81acdc774b39a3b4eaf6a9bbdeb2": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "7a94ff46576d4f6fb080389a38b4f5e5": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "9e036487e6424a4f8efc5f44066d9b47": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "0f359906152840c3a3dabd7a02e41c07": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "ab84c059d8b24f11a1045337f69776a1": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a67a4c8bf8c14941bd713d8bc341f167": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_aedf09b4e50847d1afce2a2684fa125a", "IPY_MODEL_2bc8ba5160e445208bc273bd454d3f18", "IPY_MODEL_18cc77d94ca0459e914299644f53b7c2" ], "layout": "IPY_MODEL_4eb843b1fb1b4b74992bc5bf805a7a4c" } }, "aedf09b4e50847d1afce2a2684fa125a": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3308f2d116e34de293d0edca27def001", "placeholder": "​", "style": "IPY_MODEL_a14d35854f7348848445c53918536823", "value": "Download complete: " } }, "2bc8ba5160e445208bc273bd454d3f18": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_160b58ff8bb84363826dba9c59420c03", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1a57f9eba19d4772b9a703df87cda3ce", "value": 1 } }, "18cc77d94ca0459e914299644f53b7c2": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_aa881a23a045454881599ee747b41a63", "placeholder": "​", "style": "IPY_MODEL_34248bbe227e46b191842cf8822c2401", "value": " 16.0G/? [03:30<00:00, 98.5MB/s]" } }, "4eb843b1fb1b4b74992bc5bf805a7a4c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3308f2d116e34de293d0edca27def001": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a14d35854f7348848445c53918536823": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "160b58ff8bb84363826dba9c59420c03": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "1a57f9eba19d4772b9a703df87cda3ce": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "aa881a23a045454881599ee747b41a63": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "34248bbe227e46b191842cf8822c2401": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "68e3fdeeb51e4a70b7641d0c0c8ac73d": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_4d56cac0a9924147aacd564c8a89f9e4", "IPY_MODEL_aeb8ddbf5dde410ca9cdd0cab5aff680", "IPY_MODEL_edd49a3b48ac479a8fc5f08c614d2a7a" ], "layout": "IPY_MODEL_bb92340acf394a92b64942de856ac744" } }, "4d56cac0a9924147aacd564c8a89f9e4": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_281a24f4ca5e4e48b256fdc8519080e5", "placeholder": "​", "style": "IPY_MODEL_f8d376007a12405e9894502d64758a77", "value": "Fetching 17 files: 100%" } }, "aeb8ddbf5dde410ca9cdd0cab5aff680": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_9e4a7da944684b73adf84ff39c19f6e6", "max": 17, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_c79c136a9f80463f8ad42c2b413b3bfa", "value": 17 } }, "edd49a3b48ac479a8fc5f08c614d2a7a": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_d875dc2c3e2d4786bac0d2ec3c1f179d", "placeholder": "​", "style": "IPY_MODEL_2561f164312c453685c41e709d0ba84b", "value": " 17/17 [03:29<00:00, 11.49s/it]" } }, "bb92340acf394a92b64942de856ac744": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "281a24f4ca5e4e48b256fdc8519080e5": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "f8d376007a12405e9894502d64758a77": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "9e4a7da944684b73adf84ff39c19f6e6": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c79c136a9f80463f8ad42c2b413b3bfa": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "d875dc2c3e2d4786bac0d2ec3c1f179d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "2561f164312c453685c41e709d0ba84b": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "e62c82051e2f484fb5ff08fcd397602b": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_4084995f7450457cae2160a761d7dfd9", "IPY_MODEL_9fc4cb59ca094cfba92737392389dcf0", "IPY_MODEL_6a4348caf5154b70887f3bb1d9ee2017" ], "layout": "IPY_MODEL_848dead3cb5644d8b17ab38fc16481db" } }, "4084995f7450457cae2160a761d7dfd9": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_428f5956f12541d890b949dcbee4022a", "placeholder": "​", "style": "IPY_MODEL_224339a6969743828346dce44b5f5f46", "value": "Loading pipeline components...: 100%" } }, "9fc4cb59ca094cfba92737392389dcf0": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_fa6a0ba02d844f4291a71690d2dd51b0", "max": 5, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_71105822091d45a3bdc6a52d8cb56b4a", "value": 5 } }, "6a4348caf5154b70887f3bb1d9ee2017": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c56daaf7046148609740152bdb6888f2", "placeholder": "​", "style": "IPY_MODEL_5eef26bb6d05492994ec4b8ae7e6b1b8", "value": " 5/5 [00:03<00:00,  1.23it/s]" } }, "848dead3cb5644d8b17ab38fc16481db": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "428f5956f12541d890b949dcbee4022a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "224339a6969743828346dce44b5f5f46": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "fa6a0ba02d844f4291a71690d2dd51b0": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "71105822091d45a3bdc6a52d8cb56b4a": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "c56daaf7046148609740152bdb6888f2": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "5eef26bb6d05492994ec4b8ae7e6b1b8": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "73be3c0cdd0c47f486dd25a696a578dc": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_acd5d982f47e47e0b1923b5422885893", "IPY_MODEL_cb4a1818773b4ec8a035d1e8ec23d314", "IPY_MODEL_a7b33ca57fd44657afea2483b142b934" ], "layout": "IPY_MODEL_1a2d619219304d9396628cf370bae837" } }, "acd5d982f47e47e0b1923b5422885893": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_e20c01d9320b40bfa2de5b02457427e7", "placeholder": "​", "style": "IPY_MODEL_ebe3d18e31034ae085dfafc023fb71b8", "value": "Loading weights: 100%" } }, "cb4a1818773b4ec8a035d1e8ec23d314": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5134dd78f88f4af782c43fd9b3d94791", "max": 398, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_571772bf724e420991257e7354fc534b", "value": 398 } }, "a7b33ca57fd44657afea2483b142b934": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3583e45b2e734a7c8ed0981f01779acb", "placeholder": "​", "style": "IPY_MODEL_dc8285382f6f450aa742f16ac045b576", "value": " 398/398 [00:01<00:00, 291.71it/s, Materializing param=model.norm.weight]" } }, "1a2d619219304d9396628cf370bae837": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e20c01d9320b40bfa2de5b02457427e7": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "ebe3d18e31034ae085dfafc023fb71b8": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "5134dd78f88f4af782c43fd9b3d94791": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "571772bf724e420991257e7354fc534b": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "3583e45b2e734a7c8ed0981f01779acb": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "dc8285382f6f450aa742f16ac045b576": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } } } } }, "cells": [ { "cell_type": "markdown", "source": [ "# SNDQ VERSION" ], "metadata": { "id": "U2ceFGsQ4kr1" } }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 1: Setup Environment + Optimizations (Improved)\n", "# =============================================================================\n", "\n", "from google.colab import drive, userdata\n", "from huggingface_hub import login\n", "import torch\n", "import os\n", "import gc\n", "import time\n", "import PIL.Image\n", "from PIL import Image\n", "import numpy as np\n", "\n", "drive.mount('/content/drive')\n", "\n", "# HF Login\n", "hf_token = userdata.get('HF_TOKEN')\n", "if hf_token:\n", " login(token=hf_token)\n", "\n", "# ====================== OPTIMIZATION FLAGS ======================\n", "USE_TRITON = True #@param {type:'boolean'}\n", "USE_TORCH_COMPILE = True #@param {type:'boolean'}\n", "COMPILE_MODE = \"max-autotune\" # or \"reduce-overhead\" for faster compile\n", "USE_CHANNELS_LAST = True #@param {type:'boolean'}\n", "ENABLE_TF32 = True #@param {type:'boolean'}\n", "LOWER_GUIDANCE_FOR_TEST = True #@param {type:'boolean'}\n", "\n", "print(f\"🔧 Flags: Triton={USE_TRITON}, Torch Compile={USE_TORCH_COMPILE} ({COMPILE_MODE}), \"\n", " f\"Channels Last={USE_CHANNELS_LAST}, TF32={ENABLE_TF32}\")\n", "\n", "# ====================== Installations ======================\n", "!pip uninstall -y diffusers\n", "!rm -rf /usr/local/lib/python3.12/dist-packages/diffusers* /usr/local/lib/python3.12/dist-packages/sdnq*\n", "\n", "if USE_TRITON:\n", " !pip install -q triton\n", "\n", "!pip install -q sdnq\n", "!pip install -q git+https://github.com/huggingface/diffusers.git --force-reinstall --no-deps\n", "\n", "# Global CUDA optimizations\n", "torch.backends.cuda.matmul.allow_tf32 = ENABLE_TF32\n", "torch.backends.cudnn.allow_tf32 = ENABLE_TF32\n", "torch.backends.cudnn.benchmark = True\n", "\n", "import sdnq\n", "from sdnq.loader import apply_sdnq_options_to_model\n", "from diffusers import Flux2KleinPipeline\n", "from diffusers.pipelines.flux2.pipeline_flux2_klein import (\n", " compute_empirical_mu, retrieve_timesteps, Flux2PipelineOutput\n", ")\n", "\n", "print(\"✅ Environment ready!\")\n", "print(f\"GPU: {torch.cuda.get_device_name(0)} | Total VRAM: {torch.cuda.get_device_properties(0).total_memory / 1024**3:.1f} GB\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "wE8Rz2K93aUX", "outputId": "c5945496-b321-41c8-ad2e-2e57db49e3fd" }, "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n", "🔧 Flags: Triton=True, Torch Compile=True (max-autotune), Channels Last=True, TF32=True\n", "\u001b[33mWARNING: Skipping sdnq as it is not installed.\u001b[0m\u001b[33m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m104.0/104.0 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.0/5.0 MB\u001b[0m \u001b[31m37.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", " Building wheel for diffusers (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n", "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "✅ Environment ready!\n", "GPU: Tesla T4 | Total VRAM: 14.6 GB\n" ] } ] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 2: Dual Pipeline Class (No Offload + Better Memory Control)\n", "# =============================================================================\n", "\n", "class DualFlux2KleinPipeline:\n", " def __init__(self, pipeline: Flux2KleinPipeline):\n", " self.pipe = pipeline\n", " self.vae = pipeline.vae\n", " self.transformer = pipeline.transformer\n", " self.scheduler = pipeline.scheduler\n", " self.image_processor = pipeline.image_processor\n", " self.default_sample_size = pipeline.default_sample_size\n", " self.vae_scale_factor = pipeline.vae_scale_factor\n", "\n", " self.constant_prompt_embeds = None\n", " self.constant_text_ids = None\n", "\n", " def set_constant_prompt(self, prompt: str, max_sequence_length: int = 512):\n", " print(f\"🔤 Encoding constant prompt: '{prompt[:80]}...'\")\n", " start = time.time()\n", " with torch.no_grad():\n", " prompt_embeds, text_ids = self.pipe.encode_prompt(\n", " prompt=prompt,\n", " device=\"cuda\",\n", " num_images_per_prompt=1,\n", " max_sequence_length=max_sequence_length,\n", " text_encoder_out_layers=(9, 18, 27),\n", " )\n", "\n", " self.constant_prompt_embeds = prompt_embeds\n", " self.constant_text_ids = text_ids\n", "\n", " # Aggressively free text encoder\n", " if hasattr(self.pipe, \"text_encoder\") and self.pipe.text_encoder is not None:\n", " del self.pipe.text_encoder\n", " self.pipe.text_encoder = None\n", " gc.collect()\n", " torch.cuda.empty_cache()\n", "\n", " print(f\"Prompt encoded in {time.time()-start:.2f}s | VRAM: {torch.cuda.memory_allocated()/1024**3:.1f} GB\")\n", "\n", " def encode_prompt(self, batch_size: int = 2):\n", " if self.constant_prompt_embeds is None:\n", " raise ValueError(\"Call set_constant_prompt first!\")\n", " return (self.constant_prompt_embeds.repeat(batch_size, 1, 1),\n", " self.constant_text_ids.repeat(batch_size, 1, 1))\n", "\n", " @torch.no_grad()\n", " def __call__(self, image1, image2, num_inference_steps=4, guidance_scale=3.5,\n", " generator=None, output_type=\"pil\"):\n", "\n", " if LOWER_GUIDANCE_FOR_TEST and guidance_scale > 1.0:\n", " guidance_scale = 1.5\n", " print(f\"⚡ Lowered guidance to {guidance_scale} for test\")\n", "\n", " batch_size = 2\n", " device = \"cuda\"\n", " torch.cuda.synchronize()\n", " start_total = time.time()\n", "\n", " # Preprocessing\n", " preprocess_start = time.time()\n", " input_images = [image1, image2]\n", " condition_images = []\n", " final_h = final_w = None\n", "\n", " for img in input_images:\n", " self.pipe.image_processor.check_image_input(img)\n", " w, h = img.size\n", " if w * h > 1024 * 1024:\n", " img = self.pipe.image_processor._resize_to_target_area(img, 1024 * 1024)\n", " w, h = img.size\n", "\n", " multiple_of = self.vae_scale_factor * 2\n", " w = (w // multiple_of) * multiple_of\n", " h = (h // multiple_of) * multiple_of\n", "\n", " processed = self.pipe.image_processor.preprocess(img, height=h, width=w, resize_mode=\"crop\")\n", " condition_images.append(processed)\n", " final_h = final_h or h\n", " final_w = final_w or w\n", "\n", " final_height = final_h or self.default_sample_size * self.vae_scale_factor\n", " final_width = final_w or self.default_sample_size * self.vae_scale_factor\n", " print(f\"Preprocess | Size: {final_width}x{final_height} | Time: {time.time()-preprocess_start:.2f}s\")\n", "\n", " # Embeddings (cached)\n", " prompt_embeds, text_ids = self.encode_prompt(batch_size)\n", " neg_prompt_embeds = neg_text_ids = None\n", " if guidance_scale > 1.0:\n", " neg_prompt_embeds, neg_text_ids = self.encode_prompt(batch_size)\n", "\n", " # Latents\n", " num_channels_latents = self.transformer.config.in_channels // 4\n", " latents, latent_ids = self.pipe.prepare_latents(\n", " batch_size=batch_size,\n", " num_latents_channels=num_channels_latents,\n", " height=final_height,\n", " width=final_width,\n", " dtype=prompt_embeds.dtype,\n", " device=device,\n", " generator=generator,\n", " )\n", "\n", " image_latents, image_latent_ids = self.pipe.prepare_image_latents(\n", " images=condition_images,\n", " batch_size=batch_size,\n", " generator=generator,\n", " device=device,\n", " dtype=self.vae.dtype,\n", " )\n", "\n", " # Timesteps\n", " sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)\n", " mu = compute_empirical_mu(latents.shape[1], num_inference_steps)\n", " timesteps, _ = retrieve_timesteps(self.scheduler, num_inference_steps, device, sigmas=sigmas, mu=mu)\n", "\n", " # Denoising\n", " denoising_start = time.time()\n", " self.scheduler.set_begin_index(0)\n", "\n", " with self.pipe.progress_bar(total=len(timesteps)) as pb:\n", " for i, t in enumerate(timesteps):\n", " timestep = t.expand(batch_size).to(latents.dtype)\n", "\n", " latent_model_input = torch.cat([latents, image_latents], dim=1).to(self.transformer.dtype)\n", " latent_image_ids = torch.cat([latent_ids, image_latent_ids], dim=1)\n", "\n", " # Conditional\n", " with self.transformer.cache_context(\"cond\"):\n", " noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=prompt_embeds,\n", " txt_ids=text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", "\n", " noise_pred = noise_pred[:, :latents.shape[1]]\n", "\n", " # CFG\n", " if guidance_scale > 1.0:\n", " with self.transformer.cache_context(\"uncond\"):\n", " neg_noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=neg_prompt_embeds,\n", " txt_ids=neg_text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", " neg_noise_pred = neg_noise_pred[:, :latents.shape[1]]\n", " noise_pred = neg_noise_pred + guidance_scale * (noise_pred - neg_noise_pred)\n", "\n", " latents = self.scheduler.step(noise_pred, t, latents, return_dict=False)[0]\n", "\n", " if i == len(timesteps) - 1 or (i + 1) % self.scheduler.order == 0:\n", " pb.update()\n", "\n", " print(f\"Denoising ({len(timesteps)} steps): {time.time()-denoising_start:.2f}s\")\n", "\n", " # Decoding\n", " decode_start = time.time()\n", " latent_h = 2 * (int(final_height) // (self.vae_scale_factor * 2))\n", " latent_w = 2 * (int(final_width) // (self.vae_scale_factor * 2))\n", "\n", " latents = self.pipe._unpack_latents_with_ids(latents, latent_ids, latent_h // 2, latent_w // 2)\n", "\n", " # Batch norm correction\n", " bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(latents.device, latents.dtype)\n", " bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps).to(\n", " latents.device, latents.dtype\n", " )\n", " latents = latents * bn_std + bn_mean\n", " latents = self.pipe._unpatchify_latents(latents)\n", "\n", " decoded = self.vae.decode(latents, return_dict=False)[0]\n", " images = self.pipe.image_processor.postprocess(decoded, output_type=output_type)\n", "\n", " torch.cuda.synchronize()\n", " total_time = time.time() - start_total\n", " print(f\"✅ Total time: {total_time:.2f}s | Peak VRAM: {torch.cuda.max_memory_allocated()/1024**3:.1f} GB\")\n", "\n", " return Flux2PipelineOutput(images=images)" ], "metadata": { "id": "nW1sxArD3buD" }, "execution_count": 2, "outputs": [] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 3: Load Model + Apply Optimizations (Strict No-Offload)\n", "# =============================================================================\n", "\n", "MODEL_ID = \"codeShare/FLUX.2-klein-AIO-SDNQ-4bit-dynamic\"\n", "\n", "print(f\"Loading {MODEL_ID} ...\")\n", "base_pipe = Flux2KleinPipeline.from_pretrained(\n", " MODEL_ID,\n", " torch_dtype=torch.float16,\n", " # low_cpu_mem_usage=True, # ← Removed: can trigger weird behavior with pre-quantized models\n", ")\n", "\n", "base_pipe = base_pipe.to(\"cuda\") # Force everything to GPU\n", "\n", "# Disable any potential offloading in diffusers\n", "base_pipe.enable_model_cpu_offload = lambda: None # noop\n", "base_pipe.enable_sequential_cpu_offload = lambda: None\n", "\n", "print(\"🔥 Applying SDNQ options...\")\n", "base_pipe.transformer = apply_sdnq_options_to_model(\n", " base_pipe.transformer,\n", " use_quantized_matmul=True # This is the main knob for Triton-accelerated quantized matmul\n", ")\n", "\n", "if USE_CHANNELS_LAST:\n", " try:\n", " base_pipe.transformer = base_pipe.transformer.to(memory_format=torch.channels_last)\n", " print(\"Applied channels_last\")\n", " except:\n", " pass\n", "\n", "# Torch compile AFTER SDNQ\n", "if USE_TORCH_COMPILE:\n", " print(f\"⚡ Compiling transformer ({COMPILE_MODE}) ... This can take 1–3 min\")\n", " try:\n", " base_pipe.transformer = torch.compile(\n", " base_pipe.transformer,\n", " mode=COMPILE_MODE,\n", " fullgraph=False, # Important for cache_context\n", " backend=\"inductor\"\n", " )\n", " print(\"✓ Transformer compiled\")\n", " except Exception as e:\n", " print(f\"Compile failed: {e}. Running eager.\")\n", "\n", "# Optional VAE compile\n", "try:\n", " base_pipe.vae.decode = torch.compile(base_pipe.vae.decode, mode=\"reduce-overhead\")\n", "except:\n", " pass\n", "\n", "dual_pipe = DualFlux2KleinPipeline(base_pipe)\n", "\n", "dual_pipe.set_constant_prompt(\"remove the white background. the background is dark gray.\")\n", "\n", "print(\"✅ Pipeline ready! Everything should stay fully on VRAM.\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 316, "referenced_widgets": [ "783ff8644e7a4776a89adad3f133ad15", "1a23dfd9029742c1bba8f3844b82ad7e", "2efd3cf426cc4bc3b77c43e52a30a4c2", "df78debc83ee4495a74c201d36297c17", "c7bf11c382d64154b006f2c14cbdf734", "e91319d9aad64a15949a0ed5b9e8a449", "ce5592b51f7d4a2f8a3c5d7e6f67fea6", "6edfae7380c9442fa21e352b11cb1622", "012e398323914b46bcc5c6e95bbfab69", "1e83168ff3ea456daf06f4a74dc867d7", "687d8fbade8040d989b505d7784f7a92", "3a92de15b8434fb783eeaf1c5f967f28", "3d18b76947604ea79e00b82c18f42c04", "846aacb95e6543e3a4b8defe36485e42", "3f37021ef6d14ee28cf5d076b847e815", "ac15ee7b63b2418fa955993b02aed6a9", "ef0b7048b0dc4292ba7082d46378ba4f", "b74f3e3a2e7e43b79671736886e79a34", "c4e3b47e546c4a3aba51c8cc3adf7e5d", "39cde5e0fd0d439ab61292b8d17ef2f7", "319d1db8f8314fdaaa1dd8fe55346877", "60b86a00863242448271790e309c7645", "3b23e1a5c5bf47b9bb2cda06e710d691", "d7af6a4376e14c2d9583f5100da01cf3", "5a82cd5199c94eb7947210629d9b2f31", "0ff20ef4403e431a85ec89a41625a675", "59e362cecb7349eebedfe125b23c7059", "445a58dbaf0f4fc09bc06f1977fafede", "841a6273102b44ba868a585a09041928", "670e4810a68d4fa1b3a8e159faa9137b", "fe003d2b973648628808c95d5743eeee", "44e921dd0a774986aa9d705294fa9df0", "e0950863f17d4064b086945e0d19482e", "fbde0c0d7514430784f2a520ca0d332d", "f01882ed721f4ed994138ac051dffdd8", "9bf6619f6a36422988ab64eb32d6d40f", "0d5004160b4d44c89ff7812e5901317f", "6727260a07db41498618c8f30734eab2", "d234cc8e7cd848cb9d246ddfd245106b", "5ea6a23fe3504eb1a8114d0f870c84a2", "c9eaf147884048d5ad8fc11d04a99cd4", "67f0d56fcc1c44fd970250983f72a798", "c2073beddd1d4668a19f7d4e5af40c41", "a8689907941b46cf9b3fe3b8baca4cff", "1fb25a944ce74731ac98f3d19726ac71", "63d9fd2246f0401bac4a9403e432890a", "a19a70de4b64454783e45af4155d2946", "d8d86e92d06347e9b3703a55552d413a", "287e02129f2f4c188ebb0d599525d0a3", "189941b83278489392fa50b6b11633d5", "dcaa2683f0354d7fbc96aaf212533c14", "b99941b078c040f68b858731cbbb1bbc", "d0c6d95be53d4fe8b4ddac0fc228d663", "420644023b9544c8aa25816503ae130a", "e0ec645c2d074faba7412282599bb56c" ] }, "id": "PRYQq8Rk3d69", "outputId": "b987a0b9-1a39-4a7a-c8a0-457ae6fd71b4" }, "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Loading codeShare/FLUX.2-klein-AIO-SDNQ-4bit-dynamic ...\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "model_index.json: 0%| | 0.00/509 [00:00 1.0:\n", " guidance_scale = 1.5\n", " print(f\"⚡ Lowered guidance to {guidance_scale} for test\")\n", "\n", " batch_size = 2\n", " device = \"cuda\"\n", " torch.cuda.synchronize()\n", " start_total = time.time()\n", "\n", " # === Preprocessing ===\n", " preprocess_start = time.time()\n", " input_images = [image1, image2]\n", " condition_images = []\n", " final_h = final_w = None\n", "\n", " for img in input_images:\n", " self.pipe.image_processor.check_image_input(img)\n", " w, h = img.size\n", " if w * h > 1024 * 1024:\n", " img = self.pipe.image_processor._resize_to_target_area(img, 1024 * 1024)\n", " w, h = img.size\n", "\n", " multiple_of = self.vae_scale_factor * 2\n", " w = (w // multiple_of) * multiple_of\n", " h = (h // multiple_of) * multiple_of\n", "\n", " processed = self.pipe.image_processor.preprocess(img, height=h, width=w, resize_mode=\"crop\")\n", " condition_images.append(processed)\n", " final_h = final_h or h\n", " final_w = final_w or w\n", "\n", " final_height = final_h or self.default_sample_size * self.vae_scale_factor\n", " final_width = final_w or self.default_sample_size * self.vae_scale_factor\n", " print(f\"Preprocess | Size: {final_width}x{final_height} | Time: {time.time()-preprocess_start:.2f}s\")\n", "\n", " # Embeddings\n", " prompt_embeds, text_ids = self.encode_prompt(batch_size)\n", " neg_prompt_embeds = neg_text_ids = None\n", " if guidance_scale > 1.0:\n", " neg_prompt_embeds, neg_text_ids = self.encode_prompt(batch_size)\n", "\n", " # Latents\n", " num_channels_latents = self.transformer.config.in_channels // 4\n", " latents, latent_ids = self.pipe.prepare_latents(\n", " batch_size=batch_size,\n", " num_latents_channels=num_channels_latents,\n", " height=final_height,\n", " width=final_width,\n", " dtype=prompt_embeds.dtype,\n", " device=device,\n", " generator=generator,\n", " )\n", "\n", " image_latents, image_latent_ids = self.pipe.prepare_image_latents(\n", " images=condition_images,\n", " batch_size=batch_size,\n", " generator=generator,\n", " device=device,\n", " dtype=self.vae.dtype,\n", " )\n", "\n", " # Timesteps\n", " sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)\n", " mu = compute_empirical_mu(latents.shape[1], num_inference_steps)\n", " timesteps, _ = retrieve_timesteps(self.scheduler, num_inference_steps, device, sigmas=sigmas, mu=mu)\n", "\n", " # === Denoising Loop ===\n", " denoising_start = time.time()\n", " self.scheduler.set_begin_index(0)\n", "\n", " with self.pipe.progress_bar(total=len(timesteps)) as pb:\n", " for i, t in enumerate(timesteps):\n", " timestep = t.expand(batch_size).to(latents.dtype)\n", "\n", " latent_model_input = torch.cat([latents, image_latents], dim=1).to(self.transformer.dtype)\n", " latent_image_ids = torch.cat([latent_ids, image_latent_ids], dim=1)\n", "\n", " with self.transformer.cache_context(\"cond\"):\n", " noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=prompt_embeds,\n", " txt_ids=text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", "\n", " noise_pred = noise_pred[:, :latents.shape[1]]\n", "\n", " if guidance_scale > 1.0:\n", " with self.transformer.cache_context(\"uncond\"):\n", " neg_noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=neg_prompt_embeds,\n", " txt_ids=neg_text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", " neg_noise_pred = neg_noise_pred[:, :latents.shape[1]]\n", " noise_pred = neg_noise_pred + guidance_scale * (noise_pred - neg_noise_pred)\n", "\n", " latents = self.scheduler.step(noise_pred, t, latents, return_dict=False)[0]\n", "\n", " if i == len(timesteps) - 1 or (i + 1) % self.scheduler.order == 0:\n", " pb.update()\n", "\n", " print(f\"Denoising ({len(timesteps)} steps): {time.time()-denoising_start:.2f}s\")\n", "\n", " # === Decoding ===\n", " decode_start = time.time()\n", " latent_h = 2 * (int(final_height) // (self.vae_scale_factor * 2))\n", " latent_w = 2 * (int(final_width) // (self.vae_scale_factor * 2))\n", "\n", " latents = self.pipe._unpack_latents_with_ids(latents, latent_ids, latent_h // 2, latent_w // 2)\n", "\n", " bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(latents.device, latents.dtype)\n", " bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps).to(\n", " latents.device, latents.dtype\n", " )\n", " latents = latents * bn_std + bn_mean\n", " latents = self.pipe._unpatchify_latents(latents)\n", "\n", " decoded = self.vae.decode(latents, return_dict=False)[0]\n", " images = self.pipe.image_processor.postprocess(decoded, output_type=output_type)\n", "\n", " torch.cuda.synchronize()\n", " total_time = time.time() - start_total\n", " print(f\"✅ Total time: {total_time:.2f}s | Peak VRAM: {torch.cuda.max_memory_allocated()/1024**3:.1f} GB\")\n", "\n", " return Flux2PipelineOutput(images=images)" ], "metadata": { "id": "1lCNjQLv5Efp" }, "execution_count": 2, "outputs": [] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 3: Load Base Model + Optimizations (No SDNQ)\n", "# =============================================================================\n", "\n", "MODEL_ID = \"black-forest-labs/FLUX.2-klein-4B\"\n", "\n", "print(f\"Loading official base model: {MODEL_ID}\")\n", "\n", "base_pipe = Flux2KleinPipeline.from_pretrained(\n", " MODEL_ID,\n", " torch_dtype=torch.bfloat16, # Recommended for FLUX.2-klein-4B\n", ")\n", "\n", "base_pipe = base_pipe.to(\"cuda\")\n", "\n", "# Disable any offloading\n", "base_pipe.enable_model_cpu_offload = lambda: None\n", "base_pipe.enable_sequential_cpu_offload = lambda: None\n", "\n", "if USE_CHANNELS_LAST:\n", " try:\n", " base_pipe.transformer = base_pipe.transformer.to(memory_format=torch.channels_last)\n", " print(\"Applied channels_last memory format\")\n", " except:\n", " print(\"Channels last skipped\")\n", "\n", "# Torch Compile (after moving to GPU)\n", "if USE_TORCH_COMPILE:\n", " print(f\"⚡ Compiling transformer with {COMPILE_MODE} mode... (this may take 2–4 minutes)\")\n", " try:\n", " base_pipe.transformer = torch.compile(\n", " base_pipe.transformer,\n", " mode=COMPILE_MODE,\n", " fullgraph=False,\n", " backend=\"inductor\"\n", " )\n", " print(\"✓ Transformer compiled successfully\")\n", " except Exception as e:\n", " print(f\"Compile warning: {e}. Running in eager mode.\")\n", "\n", "# Optional: compile VAE decode\n", "try:\n", " base_pipe.vae.decode = torch.compile(base_pipe.vae.decode, mode=\"reduce-overhead\")\n", "except:\n", " pass\n", "\n", "dual_pipe = DualFlux2KleinPipeline(base_pipe)\n", "\n", "dual_pipe.set_constant_prompt(\"remove the white background. the background is dark gray.\")\n", "\n", "print(\"✅ Base FLUX.2-klein-4B pipeline is ready!\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 603, "referenced_widgets": [ "5cd0b7c7360844a48b0a37f3022a83a5", "26cf59b88fb34fa294e6a45bcbc673ca", "cfbe83782a084fb7afc21b4ae7920b07", "7c3177ba3aa346d4abb96327596f748c", "1ce1cdda084442fcb6c5fd6ee6be7c51", "669bc567664c4bd5a3dea58cfd81d9fa", "55b725d64e654026b5106cf3278e85da", "f0273bcda4754e419f9bf779f0082e0c", "bf762f92d95c428782bf3675d02e03a2", "70dacf10530848808ede991691e54d42", "b433d5fa9c854edfa5ac9a88d9724b78", "645242cb2c0346debdd5cb3f9757846e", "9a9a5f163725456bb96dab66d51993a5", "6055aa92eca247989338499f6eac4d4e", "4e700e4e79e54e3388d3b675678e463e", "41163413d8394689897553b3b1bcbc43", "a60ea328a62d4e649bc032edf5487c3b", "cfdf654941564c37b1f9a6780ea06a01", "c8c4cfc3984d4b0fb27cab65435fceee", "407ed893b728422ea4ea56d954e8187f", "97c2a763a58d43cd851f45761ab0b4d6", "7ed5dcf50b2c4bf1b71b1d24dd953836", "faecce3bbfcd49988c75caf43b0cbd81", "8ce9979203c942bea55b88a6f877f39e", "589542b1baaa44ac8e56a204a8b0fecc", "a4d4197181564d10bd872f5989daf9c2", "9f0c6557ee074162925c408ab6471c7e", "f78b370ed72340e499648f335bca6e0c", "af4dc40e215e4ad092fb9e47a67fdeaa", "080d6e7b8a0c48a08b10e359db933118", "79a4c316ae8c49a5a403270c0ed7528d", "3a17f3869be04c7cb4fe990eea2c6475", "140b2e2a108b45379a1db638b64a51b2", "365a52948ab140fb81e6add9236bdf6e", "782fcdbae1ce47d28ea73b6f24672c1b", "a7eda2144cab474c83dce5c09ef42808", "b1c4919fdeab478dac27a0d1b9747827", "1e6ffe85d0524d97a8b3fb42e1154925", "06bde21738ff4e829de6140054a20218", "c89479b4e34e4d698297920bc00edbd6", "757d43ad58134b20b8fd48d4a6bef837", "cae9dd7921264a4486143063ef9752f7", "c4929018c94f425ca9812b0fbc22f575", "5e056cf647e64f48a291ada445a8605e", "ba7f2317997343a888bf6797cd9eb61e", "5c5552563aae4fc3828cd821663225fc", "c33ff64e667d4012b1ddb119b74c6f64", "8ae0fc94dcc040d9b74c4b6c79612cff", "6660e8b248d44b99817d40d6caae53c9", "84a3579190a642b4a1655e2ad34e0a9a", "c58eeff99c804bd4bc3d72ef52b821a2", "90a88d46b53a4a13a3d61a0ab4a3896d", "1531841b8dad4f39b5c2673b9d12fcb6", "bb45c9e1fe674f18812fb174666a007f", "acb34b7dd9bb48a8aa08e5271f832ae5" ] }, "id": "WzVOuFaE5Pnw", "outputId": "b198b4bc-120d-482f-cc95-714b1986b148" }, "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Loading official base model: black-forest-labs/FLUX.2-klein-4B\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "model_index.json: 0%| | 0.00/446 [00:00\u001b[0;34m()\u001b[0m\n\u001b[1;32m 12\u001b[0m )\n\u001b[1;32m 13\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 14\u001b[0;31m \u001b[0mbase_pipe\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbase_pipe\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"cuda\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 15\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[0;31m# Disable any offloading\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_utils.py\u001b[0m in \u001b[0;36mto\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 567\u001b[0m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 568\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mis_loaded_in_4bit_bnb\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mis_loaded_in_8bit_bnb\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mis_group_offloaded\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 569\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 570\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 571\u001b[0m if (\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/modeling_utils.py\u001b[0m in \u001b[0;36mto\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1526\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1527\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1528\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1529\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1530\u001b[0m \u001b[0;31m# Taken from `transformers`.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36mto\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1379\u001b[0m \u001b[0;32mraise\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1380\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1381\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconvert\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1382\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1383\u001b[0m def register_full_backward_pre_hook(\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 962\u001b[0m \u001b[0;31m# `with torch.no_grad():`\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 963\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mno_grad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 964\u001b[0;31m \u001b[0mparam_applied\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparam\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 965\u001b[0m \u001b[0mp_should_use_set_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcompute_should_use_set_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparam\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparam_applied\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 966\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36mconvert\u001b[0;34m(t)\u001b[0m\n\u001b[1;32m 1365\u001b[0m \u001b[0mmemory_format\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mconvert_to_format\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1366\u001b[0m )\n\u001b[0;32m-> 1367\u001b[0;31m return t.to(\n\u001b[0m\u001b[1;32m 1368\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1369\u001b[0m \u001b[0mdtype\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_floating_point\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_complex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mOutOfMemoryError\u001b[0m: CUDA out of memory. Tried to allocate 72.00 MiB. GPU 0 has a total capacity of 14.56 GiB of which 29.81 MiB is free. Including non-PyTorch memory, this process has 14.53 GiB memory in use. Of the allocated memory 14.43 GiB is allocated by PyTorch, and 849.00 KiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)" ] } ] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 4: Warmup + Test\n", "# =============================================================================\n", "\n", "print(\"🔥 Running warmup inference (triggers compilation)...\")\n", "dummy1 = Image.new(\"RGB\", (768, 768), color=(120, 120, 120))\n", "dummy2 = Image.new(\"RGB\", (768, 768), color=(90, 90, 90))\n", "\n", "_ = dual_pipe(\n", " image1=dummy1,\n", " image2=dummy2,\n", " num_inference_steps=4,\n", " guidance_scale=1.5 if LOWER_GUIDANCE_FOR_TEST else 3.5,\n", " generator=torch.Generator(\"cuda\").manual_seed(42)\n", ")\n", "\n", "print(\"\\n=== Warmup complete. Running real test ===\")\n", "\n", "img1 = Image.new(\"RGB\", (1024, 1024), color=(128, 128, 128))\n", "img2 = Image.new(\"RGB\", (1024, 1024), color=(100, 100, 100))\n", "\n", "result = dual_pipe(\n", " image1=img1,\n", " image2=img2,\n", " num_inference_steps=4,\n", " guidance_scale=3.5,\n", " generator=torch.Generator(\"cuda\").manual_seed(123)\n", ")\n", "\n", "result.images[0].save(\"edited_1.png\")\n", "result.images[1].save(\"edited_2.png\")\n", "print(\"Images saved as edited_1.png and edited_2.png\")" ], "metadata": { "id": "Q6WMpCpD5QZr" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# FLUX KLEIN fp8 version (Out of memory error)" ], "metadata": { "id": "ROp80eLX7HVu" } }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 1: Setup Environment\n", "# =============================================================================\n", "\n", "from google.colab import drive, userdata\n", "from huggingface_hub import login\n", "import torch\n", "import gc\n", "import time\n", "from PIL import Image\n", "import numpy as np\n", "\n", "drive.mount('/content/drive')\n", "\n", "# HF Login\n", "hf_token = userdata.get('HF_TOKEN')\n", "if hf_token:\n", " login(token=hf_token)\n", "\n", "# ====================== OPTIMIZATION FLAGS ======================\n", "USE_TORCH_COMPILE = False #@param {type:\"boolean\"} # Set to True only if stable\n", "COMPILE_MODE = \"max-autotune\"\n", "USE_CHANNELS_LAST = True\n", "ENABLE_TF32 = True\n", "LOWER_GUIDANCE_FOR_TEST = True\n", "\n", "print(f\"🔧 Flags: Torch Compile={USE_TORCH_COMPILE}, Channels Last={USE_CHANNELS_LAST}\")\n", "\n", "# Install latest diffusers\n", "!pip uninstall -y diffusers -q\n", "!rm -rf /usr/local/lib/python3.12/dist-packages/diffusers*\n", "!pip install -q git+https://github.com/huggingface/diffusers.git --force-reinstall --no-deps\n", "\n", "torch.backends.cuda.matmul.allow_tf32 = ENABLE_TF32\n", "torch.backends.cudnn.allow_tf32 = ENABLE_TF32\n", "torch.backends.cudnn.benchmark = True\n", "\n", "from diffusers import Flux2KleinPipeline\n", "from diffusers.pipelines.flux2.pipeline_flux2_klein import (\n", " compute_empirical_mu, retrieve_timesteps, Flux2PipelineOutput\n", ")\n", "\n", "print(\"✅ Environment ready!\")\n", "print(f\"GPU: {torch.cuda.get_device_name(0)} | Total VRAM: {torch.cuda.get_device_properties(0).total_memory / 1024**3:.1f} GB\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "bnT70qU-8z8G", "outputId": "407978b0-1ed7-4012-fdcb-b74cccb95329" }, "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n", "🔧 Flags: Torch Compile=False, Channels Last=True\n", " Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", " Building wheel for diffusers (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n", "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "✅ Environment ready!\n", "GPU: Tesla T4 | Total VRAM: 14.6 GB\n" ] } ] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 2: Dual Pipeline Class (CPU-first + unload text_encoder)\n", "# =============================================================================\n", "\n", "class DualFlux2KleinPipeline:\n", " def __init__(self, pipeline: Flux2KleinPipeline):\n", " self.pipe = pipeline\n", " self.vae = pipeline.vae\n", " self.transformer = pipeline.transformer\n", " self.scheduler = pipeline.scheduler\n", " self.image_processor = pipeline.image_processor\n", " self.default_sample_size = pipeline.default_sample_size\n", " self.vae_scale_factor = pipeline.vae_scale_factor\n", "\n", " self.constant_prompt_embeds = None\n", " self.constant_text_ids = None\n", "\n", " def set_constant_prompt(self, prompt: str, max_sequence_length: int = 512):\n", " print(f\"🔤 Encoding prompt: '{prompt[:80]}...'\")\n", " start = time.time()\n", "\n", " # Temporarily move text encoder to GPU for encoding\n", " text_encoder = getattr(self.pipe, \"text_encoder\", None)\n", " if text_encoder is not None:\n", " text_encoder = text_encoder.to(\"cuda\")\n", "\n", " with torch.no_grad():\n", " prompt_embeds, text_ids = self.pipe.encode_prompt(\n", " prompt=prompt,\n", " device=\"cuda\",\n", " num_images_per_prompt=1,\n", " max_sequence_length=max_sequence_length,\n", " text_encoder_out_layers=(9, 18, 27),\n", " )\n", "\n", " # Store on CPU to save VRAM\n", " self.constant_prompt_embeds = prompt_embeds.cpu()\n", " self.constant_text_ids = text_ids.cpu()\n", "\n", " # Aggressively delete text encoder\n", " if hasattr(self.pipe, \"text_encoder\") and self.pipe.text_encoder is not None:\n", " del self.pipe.text_encoder\n", " self.pipe.text_encoder = None\n", "\n", " gc.collect()\n", " torch.cuda.empty_cache()\n", "\n", " print(f\"Prompt encoded in {time.time()-start:.2f}s | VRAM used: {torch.cuda.memory_allocated()/1024**3:.1f} GB\")\n", "\n", " def encode_prompt(self, batch_size: int = 2):\n", " if self.constant_prompt_embeds is None:\n", " raise ValueError(\"Call set_constant_prompt first!\")\n", " return (\n", " self.constant_prompt_embeds.repeat(batch_size, 1, 1).to(\"cuda\"),\n", " self.constant_text_ids.repeat(batch_size, 1, 1).to(\"cuda\")\n", " )\n", "\n", " @torch.no_grad()\n", " def __call__(self, image1, image2, num_inference_steps=4, guidance_scale=3.5,\n", " generator=None, output_type=\"pil\"):\n", "\n", " if LOWER_GUIDANCE_FOR_TEST and guidance_scale > 1.0:\n", " guidance_scale = 1.5\n", " print(f\"⚡ Lowered guidance to {guidance_scale}\")\n", "\n", " batch_size = 2\n", " device = \"cuda\"\n", " torch.cuda.synchronize()\n", " start_total = time.time()\n", "\n", " # === Move heavy components to GPU ===\n", " print(\"🚀 Moving transformer and VAE to GPU...\")\n", " self.transformer = self.transformer.to(device)\n", " self.vae = self.vae.to(device)\n", "\n", " if USE_CHANNELS_LAST:\n", " try:\n", " self.transformer = self.transformer.to(memory_format=torch.channels_last)\n", " print(\"Applied channels_last\")\n", " except:\n", " pass\n", "\n", " # Preprocessing\n", " preprocess_start = time.time()\n", " input_images = [image1, image2]\n", " condition_images = []\n", " final_h = final_w = None\n", "\n", " for img in input_images:\n", " self.pipe.image_processor.check_image_input(img)\n", " w, h = img.size\n", " if w * h > 1024 * 1024:\n", " img = self.pipe.image_processor._resize_to_target_area(img, 1024 * 1024)\n", " w, h = img.size\n", "\n", " multiple_of = self.vae_scale_factor * 2\n", " w = (w // multiple_of) * multiple_of\n", " h = (h // multiple_of) * multiple_of\n", "\n", " processed = self.pipe.image_processor.preprocess(img, height=h, width=w, resize_mode=\"crop\")\n", " condition_images.append(processed)\n", " final_h = final_h or h\n", " final_w = final_w or w\n", "\n", " final_height = final_h or self.default_sample_size * self.vae_scale_factor\n", " final_width = final_w or self.default_sample_size * self.vae_scale_factor\n", "\n", " print(f\"Image size: {final_width}x{final_height} | Preprocess time: {time.time()-preprocess_start:.2f}s\")\n", "\n", " # Embeddings\n", " prompt_embeds, text_ids = self.encode_prompt(batch_size)\n", " neg_prompt_embeds = neg_text_ids = None\n", " if guidance_scale > 1.0:\n", " neg_prompt_embeds, neg_text_ids = self.encode_prompt(batch_size)\n", "\n", " # Latents (use bfloat16 for computation)\n", " num_channels_latents = self.transformer.config.in_channels // 4\n", " latents, latent_ids = self.pipe.prepare_latents(\n", " batch_size=batch_size,\n", " num_latents_channels=num_channels_latents,\n", " height=final_height,\n", " width=final_width,\n", " dtype=torch.bfloat16,\n", " device=device,\n", " generator=generator,\n", " )\n", "\n", " image_latents, image_latent_ids = self.pipe.prepare_image_latents(\n", " images=condition_images,\n", " batch_size=batch_size,\n", " generator=generator,\n", " device=device,\n", " dtype=torch.bfloat16,\n", " )\n", "\n", " # Timesteps\n", " sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)\n", " mu = compute_empirical_mu(latents.shape[1], num_inference_steps)\n", " timesteps, _ = retrieve_timesteps(self.scheduler, num_inference_steps, device, sigmas=sigmas, mu=mu)\n", "\n", " # Denoising\n", " denoising_start = time.time()\n", " self.scheduler.set_begin_index(0)\n", "\n", " with self.pipe.progress_bar(total=len(timesteps)) as pb:\n", " for i, t in enumerate(timesteps):\n", " timestep = t.expand(batch_size).to(latents.dtype)\n", "\n", " latent_model_input = torch.cat([latents, image_latents], dim=1).to(self.transformer.dtype)\n", " latent_image_ids = torch.cat([latent_ids, image_latent_ids], dim=1)\n", "\n", " with self.transformer.cache_context(\"cond\"):\n", " noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=prompt_embeds,\n", " txt_ids=text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", "\n", " noise_pred = noise_pred[:, :latents.shape[1]]\n", "\n", " if guidance_scale > 1.0:\n", " with self.transformer.cache_context(\"uncond\"):\n", " neg_noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=neg_prompt_embeds,\n", " txt_ids=neg_text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", " neg_noise_pred = neg_noise_pred[:, :latents.shape[1]]\n", " noise_pred = neg_noise_pred + guidance_scale * (noise_pred - neg_noise_pred)\n", "\n", " latents = self.scheduler.step(noise_pred, t, latents, return_dict=False)[0]\n", "\n", " if i == len(timesteps) - 1 or (i + 1) % self.scheduler.order == 0:\n", " pb.update()\n", "\n", " print(f\"Denoising time ({len(timesteps)} steps): {time.time()-denoising_start:.2f}s\")\n", "\n", " # Decoding\n", " latent_h = 2 * (int(final_height) // (self.vae_scale_factor * 2))\n", " latent_w = 2 * (int(final_width) // (self.vae_scale_factor * 2))\n", "\n", " latents = self.pipe._unpack_latents_with_ids(latents, latent_ids, latent_h // 2, latent_w // 2)\n", "\n", " bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(latents.device, latents.dtype)\n", " bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps).to(\n", " latents.device, latents.dtype\n", " )\n", " latents = latents * bn_std + bn_mean\n", " latents = self.pipe._unpatchify_latents(latents)\n", "\n", " decoded = self.vae.decode(latents, return_dict=False)[0]\n", " images = self.pipe.image_processor.postprocess(decoded, output_type=output_type)\n", "\n", " # Move back to CPU to free VRAM\n", " self.transformer = self.transformer.to(\"cpu\")\n", " self.vae = self.vae.to(\"cpu\")\n", " torch.cuda.empty_cache()\n", "\n", " total_time = time.time() - start_total\n", " print(f\"✅ Total inference time: {total_time:.2f}s | Peak VRAM: {torch.cuda.max_memory_allocated()/1024**3:.1f} GB\")\n", "\n", " return Flux2PipelineOutput(images=images)" ], "metadata": { "id": "OVf06ueJ81fL" }, "execution_count": 2, "outputs": [] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 3: Load Base Model (CPU + bfloat16)\n", "# =============================================================================\n", "\n", "MODEL_ID = \"black-forest-labs/FLUX.2-klein-4B\"\n", "\n", "print(f\"Loading {MODEL_ID} on CPU with bfloat16...\")\n", "\n", "base_pipe = Flux2KleinPipeline.from_pretrained(\n", " MODEL_ID,\n", " torch_dtype=torch.bfloat16,\n", " device_map=\"cpu\", # Keep on CPU initially\n", " low_cpu_mem_usage=True,\n", ")\n", "\n", "# Disable unwanted offloading\n", "base_pipe.enable_model_cpu_offload = lambda: None\n", "base_pipe.enable_sequential_cpu_offload = lambda: None\n", "\n", "dual_pipe = DualFlux2KleinPipeline(base_pipe)\n", "\n", "dual_pipe.set_constant_prompt(\"remove the white background. the background is dark gray.\")\n", "\n", "print(\"✅ Pipeline ready! Heavy components will move to VRAM only during inference.\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 246, "referenced_widgets": [ "73791b3a6377440ab767df501170c41b", "081098c183514522a6e98c776412d901", "f17fb5596fb741e09f433613130a643d", "499da4e9407f4bdd92aa8ab9368e26b6", "2192c317c7934bc8afc0027d7227e64d", "a18063a1cc5f401a974ebf038df4925e", "6dca81acdc774b39a3b4eaf6a9bbdeb2", "7a94ff46576d4f6fb080389a38b4f5e5", "9e036487e6424a4f8efc5f44066d9b47", "0f359906152840c3a3dabd7a02e41c07", "ab84c059d8b24f11a1045337f69776a1", "a67a4c8bf8c14941bd713d8bc341f167", "aedf09b4e50847d1afce2a2684fa125a", "2bc8ba5160e445208bc273bd454d3f18", "18cc77d94ca0459e914299644f53b7c2", "4eb843b1fb1b4b74992bc5bf805a7a4c", "3308f2d116e34de293d0edca27def001", "a14d35854f7348848445c53918536823", "160b58ff8bb84363826dba9c59420c03", "1a57f9eba19d4772b9a703df87cda3ce", "aa881a23a045454881599ee747b41a63", "34248bbe227e46b191842cf8822c2401", "68e3fdeeb51e4a70b7641d0c0c8ac73d", "4d56cac0a9924147aacd564c8a89f9e4", "aeb8ddbf5dde410ca9cdd0cab5aff680", "edd49a3b48ac479a8fc5f08c614d2a7a", "bb92340acf394a92b64942de856ac744", "281a24f4ca5e4e48b256fdc8519080e5", "f8d376007a12405e9894502d64758a77", "9e4a7da944684b73adf84ff39c19f6e6", "c79c136a9f80463f8ad42c2b413b3bfa", "d875dc2c3e2d4786bac0d2ec3c1f179d", "2561f164312c453685c41e709d0ba84b", "e62c82051e2f484fb5ff08fcd397602b", "4084995f7450457cae2160a761d7dfd9", "9fc4cb59ca094cfba92737392389dcf0", "6a4348caf5154b70887f3bb1d9ee2017", "848dead3cb5644d8b17ab38fc16481db", "428f5956f12541d890b949dcbee4022a", "224339a6969743828346dce44b5f5f46", "fa6a0ba02d844f4291a71690d2dd51b0", "71105822091d45a3bdc6a52d8cb56b4a", "c56daaf7046148609740152bdb6888f2", "5eef26bb6d05492994ec4b8ae7e6b1b8", "73be3c0cdd0c47f486dd25a696a578dc", "acd5d982f47e47e0b1923b5422885893", "cb4a1818773b4ec8a035d1e8ec23d314", "a7b33ca57fd44657afea2483b142b934", "1a2d619219304d9396628cf370bae837", "e20c01d9320b40bfa2de5b02457427e7", "ebe3d18e31034ae085dfafc023fb71b8", "5134dd78f88f4af782c43fd9b3d94791", "571772bf724e420991257e7354fc534b", "3583e45b2e734a7c8ed0981f01779acb", "dc8285382f6f450aa742f16ac045b576" ] }, "id": "lmSpLSHM88Rl", "outputId": "785888d2-9bcd-4f1f-90dc-5fde3159e6d4" }, "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Loading black-forest-labs/FLUX.2-klein-4B on CPU with bfloat16...\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "model_index.json: 0%| | 0.00/446 [00:00\u001b[0;34m()\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mdummy2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mImage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnew\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"RGB\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;36m768\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m768\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolor\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m90\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m90\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m90\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m _ = dual_pipe(\n\u001b[0m\u001b[1;32m 10\u001b[0m \u001b[0mimage1\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdummy1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0mimage2\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdummy2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py\u001b[0m in \u001b[0;36mdecorate_context\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[0;31m# pyrefly: ignore [bad-context-manager]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 123\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mctx_factory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 124\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 125\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 126\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdecorate_context\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/tmp/ipykernel_4232/871028788.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, image1, image2, num_inference_steps, guidance_scale, generator, output_type)\u001b[0m\n\u001b[1;32m 126\u001b[0m )\n\u001b[1;32m 127\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 128\u001b[0;31m image_latents, image_latent_ids = self.pipe.prepare_image_latents(\n\u001b[0m\u001b[1;32m 129\u001b[0m \u001b[0mimages\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcondition_images\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 130\u001b[0m \u001b[0mbatch_size\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/flux2/pipeline_flux2_klein.py\u001b[0m in \u001b[0;36mprepare_image_latents\u001b[0;34m(self, images, batch_size, generator, device, dtype)\u001b[0m\n\u001b[1;32m 519\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mimages\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 520\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 521\u001b[0;31m \u001b[0mimagge_latent\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_encode_vae_image\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenerator\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgenerator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 522\u001b[0m \u001b[0mimage_latents\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimagge_latent\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# (1, 128, 32, 32)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 523\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/flux2/pipeline_flux2_klein.py\u001b[0m in \u001b[0;36m_encode_vae_image\u001b[0;34m(self, image, generator)\u001b[0m\n\u001b[1;32m 464\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Expected image dims 4, got {image.ndim}.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 466\u001b[0;31m \u001b[0mimage_latents\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mretrieve_latents\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvae\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenerator\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgenerator\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msample_mode\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"argmax\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 467\u001b[0m \u001b[0mimage_latents\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_patchify_latents\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage_latents\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 468\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/utils/accelerate_utils.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"_hf_hook\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_hf_hook\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"pre_forward\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_hf_hook\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpre_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 46\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 47\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/autoencoders/autoencoder_kl_flux2.py\u001b[0m in \u001b[0;36mencode\u001b[0;34m(self, x, return_dict)\u001b[0m\n\u001b[1;32m 205\u001b[0m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mencoded_slices\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 206\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 207\u001b[0;31m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_encode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 208\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[0mposterior\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDiagonalGaussianDistribution\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/autoencoders/autoencoder_kl_flux2.py\u001b[0m in \u001b[0;36m_encode\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 179\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_tiled_encode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 180\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 181\u001b[0;31m \u001b[0menc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencoder\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 182\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquant_conv\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 183\u001b[0m \u001b[0menc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquant_conv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0menc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_wrapped_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1774\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_compiled_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# type: ignore[misc]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1775\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1776\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1777\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1778\u001b[0m \u001b[0;31m# torchrec tests the code consistency with the following code\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1785\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1786\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1787\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1788\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1789\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/autoencoders/vae.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, sample)\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[0;34mr\"\"\"The forward method of the `Encoder` class.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 155\u001b[0;31m \u001b[0msample\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv_in\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msample\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 156\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 157\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_grad_enabled\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgradient_checkpointing\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_wrapped_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1774\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_compiled_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# type: ignore[misc]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1775\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1776\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1777\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1778\u001b[0m \u001b[0;31m# torchrec tests the code consistency with the following code\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1785\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1786\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1787\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1788\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1789\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 552\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 553\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conv_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbias\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 554\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 555\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36m_conv_forward\u001b[0;34m(self, input, weight, bias)\u001b[0m\n\u001b[1;32m 546\u001b[0m )\n\u001b[1;32m 547\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 548\u001b[0;31m return F.conv2d(\n\u001b[0m\u001b[1;32m 549\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpadding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdilation\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgroups\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 550\u001b[0m )\n", "\u001b[0;31mOutOfMemoryError\u001b[0m: CUDA out of memory. Tried to allocate 32.00 MiB. GPU 0 has a total capacity of 14.56 GiB of which 27.81 MiB is free. Including non-PyTorch memory, this process has 14.53 GiB memory in use. Of the allocated memory 14.39 GiB is allocated by PyTorch, and 16.94 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)" ] } ] }, { "cell_type": "markdown", "source": [ "# FLUX KLEIN + bitsandbytes quantization" ], "metadata": { "id": "SZqVpF00-spJ" } }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 1: Setup Environment + BitsAndBytes 4-bit\n", "# =============================================================================\n", "\n", "from google.colab import drive, userdata\n", "from huggingface_hub import login\n", "import torch\n", "import gc\n", "import time\n", "from PIL import Image\n", "import numpy as np\n", "\n", "drive.mount('/content/drive')\n", "\n", "# HF Login\n", "hf_token = userdata.get('HF_TOKEN')\n", "if hf_token:\n", " login(token=hf_token)\n", "\n", "# ====================== FLAGS ======================\n", "USE_TORCH_COMPILE = False # Set True only if you have enough VRAM and it stabilizes\n", "COMPILE_MODE = \"max-autotune\"\n", "USE_CHANNELS_LAST = True\n", "LOWER_GUIDANCE_FOR_TEST = True\n", "\n", "print(f\"🔧 Torch Compile: {USE_TORCH_COMPILE} | Channels Last: {USE_CHANNELS_LAST}\")\n", "\n", "# Install required packages\n", "!pip uninstall -y diffusers bitsandbytes -q\n", "!rm -rf /usr/local/lib/python3.12/dist-packages/diffusers*\n", "\n", "!pip install -q git+https://github.com/huggingface/diffusers.git --force-reinstall --no-deps\n", "!pip install -q bitsandbytes accelerate\n", "\n", "import torch\n", "from diffusers import Flux2KleinPipeline, BitsAndBytesConfig\n", "from diffusers.pipelines.flux2.pipeline_flux2_klein import (\n", " compute_empirical_mu, retrieve_timesteps, Flux2PipelineOutput\n", ")\n", "\n", "torch.backends.cuda.matmul.allow_tf32 = True\n", "torch.backends.cudnn.allow_tf32 = True\n", "torch.backends.cudnn.benchmark = True\n", "\n", "print(\"✅ Environment ready!\")\n", "print(f\"GPU: {torch.cuda.get_device_name(0)} | Total VRAM: {torch.cuda.get_device_properties(0).total_memory / 1024**3:.1f} GB\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SPeQJHaI-X9u", "outputId": "8c390f26-11a1-4660-f00f-b8013846401a" }, "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n", "🔧 Torch Compile: False | Channels Last: True\n", "\u001b[33mWARNING: Skipping bitsandbytes as it is not installed.\u001b[0m\u001b[33m\n", "\u001b[0m Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", " Building wheel for diffusers (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.7/60.7 MB\u001b[0m \u001b[31m11.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n", "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "✅ Environment ready!\n", "GPU: Tesla T4 | Total VRAM: 14.6 GB\n" ] } ] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 2: DualFlux2KleinPipeline (Full - Optimized for bitsandbytes)\n", "# =============================================================================\n", "\n", "class DualFlux2KleinPipeline:\n", " def __init__(self, pipeline: Flux2KleinPipeline):\n", " self.pipe = pipeline\n", " self.vae = pipeline.vae\n", " self.transformer = pipeline.transformer\n", " self.scheduler = pipeline.scheduler\n", " self.image_processor = pipeline.image_processor\n", " self.default_sample_size = pipeline.default_sample_size\n", " self.vae_scale_factor = pipeline.vae_scale_factor\n", "\n", " self.constant_prompt_embeds = None\n", " self.constant_text_ids = None\n", "\n", " def set_constant_prompt(self, prompt: str, max_sequence_length: int = 512):\n", " print(f\"🔤 Encoding constant prompt: '{prompt[:80]}...'\")\n", " start = time.time()\n", "\n", " # Temporarily move text encoder to GPU for encoding\n", " if hasattr(self.pipe, \"text_encoder\") and self.pipe.text_encoder is not None:\n", " self.pipe.text_encoder = self.pipe.text_encoder.to(\"cuda\")\n", "\n", " with torch.no_grad():\n", " prompt_embeds, text_ids = self.pipe.encode_prompt(\n", " prompt=prompt,\n", " device=\"cuda\",\n", " num_images_per_prompt=1,\n", " max_sequence_length=max_sequence_length,\n", " text_encoder_out_layers=(9, 18, 27),\n", " )\n", "\n", " # Store embeddings on CPU to save VRAM\n", " self.constant_prompt_embeds = prompt_embeds.cpu()\n", " self.constant_text_ids = text_ids.cpu()\n", "\n", " # Aggressively unload text encoder\n", " if hasattr(self.pipe, \"text_encoder\") and self.pipe.text_encoder is not None:\n", " del self.pipe.text_encoder\n", " self.pipe.text_encoder = None\n", " gc.collect()\n", " torch.cuda.empty_cache()\n", "\n", " print(f\"Prompt encoded in {time.time()-start:.2f}s | VRAM: {torch.cuda.memory_allocated()/1024**3:.1f} GB\")\n", "\n", " def encode_prompt(self, batch_size: int = 2):\n", " if self.constant_prompt_embeds is None:\n", " raise ValueError(\"Call set_constant_prompt first!\")\n", " return (\n", " self.constant_prompt_embeds.repeat(batch_size, 1, 1).to(\"cuda\"),\n", " self.constant_text_ids.repeat(batch_size, 1, 1).to(\"cuda\")\n", " )\n", "\n", " @torch.no_grad()\n", " def __call__(\n", " self,\n", " image1: Image.Image,\n", " image2: Image.Image,\n", " num_inference_steps: int = 4,\n", " guidance_scale: float = 3.5,\n", " generator: torch.Generator = None,\n", " output_type: str = \"pil\",\n", " ):\n", " if LOWER_GUIDANCE_FOR_TEST and guidance_scale > 1.0:\n", " guidance_scale = 1.5\n", " print(f\"⚡ Lowered guidance_scale to {guidance_scale} for test\")\n", "\n", " batch_size = 2\n", " device = \"cuda\"\n", " torch.cuda.synchronize()\n", " start_total = time.time()\n", "\n", " # === Move quantized components to GPU ===\n", " print(\"🚀 Moving transformer + VAE to GPU...\")\n", " self.transformer = self.transformer.to(device)\n", " self.vae = self.vae.to(device)\n", "\n", " if USE_CHANNELS_LAST:\n", " try:\n", " self.transformer = self.transformer.to(memory_format=torch.channels_last)\n", " print(\"✅ Applied channels_last memory format\")\n", " except:\n", " print(\"Channels last skipped\")\n", "\n", " # === Image Preprocessing ===\n", " preprocess_start = time.time()\n", " input_images = [image1, image2]\n", " condition_images = []\n", " final_h = final_w = None\n", "\n", " for img in input_images:\n", " self.pipe.image_processor.check_image_input(img)\n", " w, h = img.size\n", " if w * h > 1024 * 1024:\n", " img = self.pipe.image_processor._resize_to_target_area(img, 1024 * 1024)\n", " w, h = img.size\n", "\n", " multiple_of = self.vae_scale_factor * 2\n", " w = (w // multiple_of) * multiple_of\n", " h = (h // multiple_of) * multiple_of\n", "\n", " processed = self.pipe.image_processor.preprocess(\n", " img, height=h, width=w, resize_mode=\"crop\"\n", " )\n", " condition_images.append(processed)\n", " final_h = final_h or h\n", " final_w = final_w or w\n", "\n", " final_height = final_h or self.default_sample_size * self.vae_scale_factor\n", " final_width = final_w or self.default_sample_size * self.vae_scale_factor\n", " print(f\"Preprocess time: {time.time()-preprocess_start:.2f}s | Size: {final_width}x{final_height}\")\n", "\n", " # === Embeddings (from CPU) ===\n", " prompt_embeds, text_ids = self.encode_prompt(batch_size)\n", " neg_prompt_embeds = neg_text_ids = None\n", " if guidance_scale > 1.0:\n", " neg_prompt_embeds, neg_text_ids = self.encode_prompt(batch_size)\n", "\n", " # === Latents ===\n", " num_channels_latents = self.transformer.config.in_channels // 4\n", " latents, latent_ids = self.pipe.prepare_latents(\n", " batch_size=batch_size,\n", " num_latents_channels=num_channels_latents,\n", " height=final_height,\n", " width=final_width,\n", " dtype=torch.bfloat16,\n", " device=device,\n", " generator=generator,\n", " )\n", "\n", " image_latents, image_latent_ids = self.pipe.prepare_image_latents(\n", " images=condition_images,\n", " batch_size=batch_size,\n", " generator=generator,\n", " device=device,\n", " dtype=torch.bfloat16,\n", " )\n", "\n", " # === Timesteps ===\n", " sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)\n", " mu = compute_empirical_mu(latents.shape[1], num_inference_steps)\n", " timesteps, _ = retrieve_timesteps(\n", " self.scheduler, num_inference_steps, device, sigmas=sigmas, mu=mu\n", " )\n", "\n", " # === Denoising Loop ===\n", " denoising_start = time.time()\n", " self.scheduler.set_begin_index(0)\n", "\n", " with self.pipe.progress_bar(total=len(timesteps)) as pb:\n", " for i, t in enumerate(timesteps):\n", " timestep = t.expand(batch_size).to(latents.dtype)\n", "\n", " latent_model_input = torch.cat([latents, image_latents], dim=1).to(self.transformer.dtype)\n", " latent_image_ids = torch.cat([latent_ids, image_latent_ids], dim=1)\n", "\n", " # Conditional prediction\n", " with self.transformer.cache_context(\"cond\"):\n", " noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=prompt_embeds,\n", " txt_ids=text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", "\n", " noise_pred = noise_pred[:, :latents.shape[1]]\n", "\n", " # Classifier-Free Guidance\n", " if guidance_scale > 1.0:\n", " with self.transformer.cache_context(\"uncond\"):\n", " neg_noise_pred = self.transformer(\n", " hidden_states=latent_model_input,\n", " timestep=timestep / 1000,\n", " guidance=None,\n", " encoder_hidden_states=neg_prompt_embeds,\n", " txt_ids=neg_text_ids,\n", " img_ids=latent_image_ids,\n", " joint_attention_kwargs=None,\n", " return_dict=False,\n", " )[0]\n", " neg_noise_pred = neg_noise_pred[:, :latents.shape[1]]\n", " noise_pred = neg_noise_pred + guidance_scale * (noise_pred - neg_noise_pred)\n", "\n", " latents = self.scheduler.step(noise_pred, t, latents, return_dict=False)[0]\n", "\n", " if i == len(timesteps) - 1 or (i + 1) % self.scheduler.order == 0:\n", " pb.update()\n", "\n", " print(f\"Denoising time ({len(timesteps)} steps): {time.time()-denoising_start:.2f}s\")\n", "\n", " # === Decoding ===\n", " decode_start = time.time()\n", " latent_h = 2 * (int(final_height) // (self.vae_scale_factor * 2))\n", " latent_w = 2 * (int(final_width) // (self.vae_scale_factor * 2))\n", "\n", " latents = self.pipe._unpack_latents_with_ids(latents, latent_ids, latent_h // 2, latent_w // 2)\n", "\n", " # Batch norm correction for VAE\n", " bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(latents.device, latents.dtype)\n", " bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps).to(\n", " latents.device, latents.dtype\n", " )\n", " latents = latents * bn_std + bn_mean\n", " latents = self.pipe._unpatchify_latents(latents)\n", "\n", " decoded = self.vae.decode(latents, return_dict=False)[0]\n", " images = self.pipe.image_processor.postprocess(decoded, output_type=output_type)\n", "\n", " # Move models back to CPU to free VRAM\n", " self.transformer = self.transformer.to(\"cpu\")\n", " self.vae = self.vae.to(\"cpu\")\n", " torch.cuda.empty_cache()\n", " gc.collect()\n", "\n", " torch.cuda.synchronize()\n", " total_time = time.time() - start_total\n", " print(f\"✅ Total inference time: {total_time:.2f}s | Peak VRAM: {torch.cuda.max_memory_allocated()/1024**3:.1f} GB\")\n", "\n", " return Flux2PipelineOutput(images=images)" ], "metadata": { "id": "ctKjGLgl_LEi" }, "execution_count": 2, "outputs": [] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 3: Load FLUX.2-klein-4B with BitsAndBytes 4-bit (Stable Fix)\n", "# =============================================================================\n", "\n", "from diffusers import BitsAndBytesConfig, FluxTransformer2DModel\n", "import gc\n", "\n", "MODEL_ID = \"black-forest-labs/FLUX.2-klein-4B\"\n", "\n", "print(f\"Loading {MODEL_ID} with BitsAndBytes 4-bit (NF4)...\")\n", "\n", "# 4-bit quantization config\n", "quantization_config = BitsAndBytesConfig(\n", " load_in_4bit=True,\n", " bnb_4bit_quant_type=\"nf4\",\n", " bnb_4bit_use_double_quant=True,\n", " bnb_4bit_compute_dtype=torch.bfloat16,\n", ")\n", "\n", "print(\"→ Loading and quantizing transformer (this can take 2-4 minutes)...\")\n", "\n", "# Load transformer with safer parameters\n", "transformer = FluxTransformer2DModel.from_pretrained(\n", " MODEL_ID,\n", " subfolder=\"transformer\",\n", " quantization_config=quantization_config,\n", " torch_dtype=torch.bfloat16,\n", " low_cpu_mem_usage=True,\n", " device_map=None, # Avoid auto device_map conflicts\n", " offload_folder=None,\n", ")\n", "\n", "print(\"Transformer quantized successfully.\")\n", "\n", "# Load the full pipeline injecting the quantized transformer\n", "base_pipe = Flux2KleinPipeline.from_pretrained(\n", " MODEL_ID,\n", " transformer=transformer,\n", " torch_dtype=torch.bfloat16,\n", " low_cpu_mem_usage=True,\n", ")\n", "\n", "# Disable any automatic offloading\n", "base_pipe.enable_model_cpu_offload = lambda: None\n", "base_pipe.enable_sequential_cpu_offload = lambda: None\n", "\n", "print(\"✅ Pipeline loaded with 4-bit quantized transformer!\")\n", "print(f\"Current VRAM usage: {torch.cuda.memory_allocated() / 1024**3:.2f} GB\")\n", "\n", "# Create dual pipeline\n", "dual_pipe = DualFlux2KleinPipeline(base_pipe)\n", "\n", "# Encode prompt once (text_encoder will be unloaded immediately after)\n", "dual_pipe.set_constant_prompt(\"remove the white background. the background is dark gray.\")\n", "\n", "print(\"✅ DualFlux2KleinPipeline is ready with 4-bit quantization.\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 498 }, "id": "7UDcGLvp_cYl", "outputId": "dc48f6f9-6590-4543-ca3c-6c55637fb93a" }, "execution_count": 4, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Loading black-forest-labs/FLUX.2-klein-4B with BitsAndBytes 4-bit (NF4)...\n", "→ Loading and quantizing transformer (this can take 2-4 minutes)...\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Some weights of the model checkpoint at black-forest-labs/FLUX.2-klein-4B were not used when initializing FluxTransformer2DModel: \n", " ['single_transformer_blocks.5.attn.to_out.weight, transformer_blocks.4.ff_context.linear_out.weight, single_transformer_blocks.17.attn.to_qkv_mlp_proj.weight, transformer_blocks.0.ff.linear_in.weight, single_transformer_blocks.2.attn.to_out.weight, transformer_blocks.0.ff_context.linear_in.weight, single_transformer_blocks.12.attn.to_out.weight, single_transformer_blocks.6.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.4.attn.to_out.weight, single_transformer_blocks.18.attn.to_qkv_mlp_proj.weight, transformer_blocks.3.ff.linear_out.weight, single_transformer_blocks.7.attn.to_out.weight, transformer_blocks.4.ff.linear_out.weight, transformer_blocks.2.ff_context.linear_in.weight, transformer_blocks.0.ff.linear_out.weight, single_transformer_blocks.0.attn.to_out.weight, single_transformer_blocks.0.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.19.attn.to_out.weight, transformer_blocks.3.ff_context.linear_in.weight, transformer_blocks.4.ff_context.linear_in.weight, single_transformer_blocks.16.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.1.attn.to_out.weight, transformer_blocks.1.ff.linear_in.weight, single_transformer_blocks.4.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.6.attn.to_out.weight, time_guidance_embed.timestep_embedder.linear_2.weight, single_transformer_blocks.13.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.11.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.19.attn.to_qkv_mlp_proj.weight, time_guidance_embed.timestep_embedder.linear_1.weight, double_stream_modulation_img.linear.weight, transformer_blocks.2.ff_context.linear_out.weight, transformer_blocks.2.ff.linear_in.weight, single_transformer_blocks.15.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.3.attn.to_out.weight, single_transformer_blocks.13.attn.to_out.weight, single_transformer_blocks.15.attn.to_out.weight, single_transformer_blocks.17.attn.to_out.weight, single_transformer_blocks.2.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.11.attn.to_out.weight, single_transformer_blocks.10.attn.to_out.weight, transformer_blocks.1.ff_context.linear_out.weight, single_transformer_blocks.1.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.7.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.9.attn.to_out.weight, single_transformer_blocks.9.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.14.attn.to_out.weight, single_transformer_blocks.5.attn.to_qkv_mlp_proj.weight, transformer_blocks.1.ff.linear_out.weight, single_transformer_blocks.3.attn.to_qkv_mlp_proj.weight, double_stream_modulation_txt.linear.weight, single_stream_modulation.linear.weight, single_transformer_blocks.8.attn.to_qkv_mlp_proj.weight, transformer_blocks.3.ff_context.linear_out.weight, single_transformer_blocks.10.attn.to_qkv_mlp_proj.weight, single_transformer_blocks.14.attn.to_qkv_mlp_proj.weight, transformer_blocks.1.ff_context.linear_in.weight, transformer_blocks.2.ff.linear_out.weight, transformer_blocks.4.ff.linear_in.weight, single_transformer_blocks.8.attn.to_out.weight, single_transformer_blocks.16.attn.to_out.weight, single_transformer_blocks.12.attn.to_qkv_mlp_proj.weight, transformer_blocks.3.ff.linear_in.weight, single_transformer_blocks.18.attn.to_out.weight, transformer_blocks.0.ff_context.linear_out.weight']\n", "Some weights of FluxTransformer2DModel were not initialized from the model checkpoint at black-forest-labs/FLUX.2-klein-4B and are newly initialized: ['single_transformer_blocks.5.attn.to_q.weight', 'single_transformer_blocks.1.proj_out.bias', 'transformer_blocks.1.ff_context.net.0.proj.bias', 'single_transformer_blocks.7.proj_mlp.bias', 'single_transformer_blocks.9.attn.to_k.bias', 'single_transformer_blocks.1.attn.to_v.weight', 'transformer_blocks.3.norm1.linear.weight', 'single_transformer_blocks.14.attn.to_q.bias', 'transformer_blocks.3.attn.to_k.bias', 'single_transformer_blocks.3.attn.to_k.weight', 'single_transformer_blocks.13.attn.to_q.weight', 'transformer_blocks.3.attn.to_q.bias', 'single_transformer_blocks.16.attn.to_k.weight', 'single_transformer_blocks.17.attn.to_q.weight', 'transformer_blocks.0.attn.to_out.0.bias', 'transformer_blocks.3.attn.add_q_proj.bias', 'single_transformer_blocks.14.proj_mlp.weight', 'single_transformer_blocks.6.proj_mlp.bias', 'single_transformer_blocks.2.proj_mlp.weight', 'single_transformer_blocks.7.attn.to_q.weight', 'single_transformer_blocks.0.norm.linear.bias', 'transformer_blocks.1.norm1_context.linear.weight', 'single_transformer_blocks.3.proj_mlp.weight', 'single_transformer_blocks.12.attn.to_q.weight', 'single_transformer_blocks.11.attn.to_v.bias', 'transformer_blocks.2.ff_context.net.0.proj.bias', 'single_transformer_blocks.19.attn.to_v.weight', 'transformer_blocks.1.ff_context.net.0.proj.weight', 'single_transformer_blocks.5.attn.to_k.weight', 'single_transformer_blocks.11.proj_mlp.weight', 'transformer_blocks.4.norm1_context.linear.bias', 'transformer_blocks.1.norm1.linear.bias', 'single_transformer_blocks.19.attn.to_k.weight', 'transformer_blocks.3.ff.net.2.weight', 'single_transformer_blocks.9.proj_mlp.bias', 'single_transformer_blocks.19.attn.to_k.bias', 'transformer_blocks.1.attn.to_v.bias', 'single_transformer_blocks.4.attn.to_k.bias', 'transformer_blocks.2.ff.net.2.bias', 'single_transformer_blocks.0.attn.to_k.bias', 'transformer_blocks.4.ff.net.2.weight', 'single_transformer_blocks.2.attn.to_v.weight', 'transformer_blocks.0.norm1.linear.weight', 'transformer_blocks.0.attn.to_k.bias', 'single_transformer_blocks.18.attn.to_k.bias', 'single_transformer_blocks.4.proj_out.weight', 'single_transformer_blocks.15.proj_out.bias', 'transformer_blocks.0.attn.to_add_out.bias', 'transformer_blocks.2.norm1.linear.bias', 'transformer_blocks.4.norm1.linear.weight', 'single_transformer_blocks.7.norm.linear.bias', 'single_transformer_blocks.8.proj_mlp.weight', 'single_transformer_blocks.0.proj_out.bias', 'single_transformer_blocks.8.attn.to_k.bias', 'transformer_blocks.2.attn.to_k.bias', 'single_transformer_blocks.17.attn.to_v.bias', 'transformer_blocks.1.attn.add_v_proj.bias', 'single_transformer_blocks.2.proj_out.weight', 'single_transformer_blocks.3.proj_mlp.bias', 'single_transformer_blocks.8.attn.to_v.bias', 'single_transformer_blocks.15.proj_out.weight', 'single_transformer_blocks.7.attn.to_k.bias', 'single_transformer_blocks.14.attn.to_v.weight', 'transformer_blocks.0.norm1_context.linear.bias', 'single_transformer_blocks.1.norm.linear.weight', 'single_transformer_blocks.16.attn.to_q.bias', 'single_transformer_blocks.14.attn.to_k.weight', 'single_transformer_blocks.7.proj_out.weight', 'time_text_embed.timestep_embedder.linear_1.bias', 'transformer_blocks.1.attn.add_k_proj.bias', 'transformer_blocks.0.ff.net.0.proj.weight', 'single_transformer_blocks.9.norm.linear.weight', 'transformer_blocks.4.attn.to_v.bias', 'transformer_blocks.2.attn.to_v.bias', 'transformer_blocks.2.attn.to_out.0.bias', 'single_transformer_blocks.11.attn.to_k.weight', 'single_transformer_blocks.18.norm.linear.bias', 'single_transformer_blocks.2.attn.to_k.bias', 'single_transformer_blocks.13.proj_mlp.bias', 'transformer_blocks.2.norm1_context.linear.bias', 'single_transformer_blocks.19.attn.to_v.bias', 'transformer_blocks.3.attn.to_out.0.bias', 'transformer_blocks.4.ff.net.0.proj.bias', 'single_transformer_blocks.13.attn.to_k.weight', 'single_transformer_blocks.19.proj_mlp.bias', 'single_transformer_blocks.10.attn.to_k.weight', 'single_transformer_blocks.13.proj_out.weight', 'single_transformer_blocks.14.attn.to_v.bias', 'single_transformer_blocks.5.attn.to_v.weight', 'transformer_blocks.4.attn.to_q.bias', 'single_transformer_blocks.1.attn.to_q.weight', 'single_transformer_blocks.3.norm.linear.weight', 'transformer_blocks.1.ff.net.2.weight', 'transformer_blocks.4.attn.to_k.bias', 'single_transformer_blocks.18.attn.to_q.bias', 'single_transformer_blocks.12.attn.to_v.bias', 'single_transformer_blocks.16.attn.to_k.bias', 'single_transformer_blocks.12.attn.to_v.weight', 'single_transformer_blocks.4.attn.to_q.weight', 'single_transformer_blocks.9.attn.to_q.weight', 'single_transformer_blocks.17.norm.linear.weight', 'transformer_blocks.2.attn.to_add_out.bias', 'transformer_blocks.0.attn.add_q_proj.bias', 'transformer_blocks.3.attn.add_k_proj.bias', 'single_transformer_blocks.10.attn.to_q.weight', 'single_transformer_blocks.12.proj_out.bias', 'transformer_blocks.0.attn.to_q.bias', 'transformer_blocks.0.attn.add_k_proj.bias', 'transformer_blocks.2.ff_context.net.0.proj.weight', 'single_transformer_blocks.0.proj_mlp.bias', 'single_transformer_blocks.11.proj_out.weight', 'single_transformer_blocks.11.norm.linear.weight', 'single_transformer_blocks.0.proj_mlp.weight', 'single_transformer_blocks.15.proj_mlp.bias', 'transformer_blocks.1.attn.to_k.bias', 'single_transformer_blocks.14.norm.linear.bias', 'single_transformer_blocks.17.proj_mlp.weight', 'single_transformer_blocks.3.attn.to_v.weight', 'single_transformer_blocks.9.attn.to_q.bias', 'single_transformer_blocks.2.norm.linear.bias', 'transformer_blocks.0.attn.add_v_proj.bias', 'transformer_blocks.0.ff.net.0.proj.bias', 'single_transformer_blocks.9.attn.to_k.weight', 'single_transformer_blocks.16.proj_out.weight', 'single_transformer_blocks.14.proj_mlp.bias', 'single_transformer_blocks.7.proj_mlp.weight', 'single_transformer_blocks.14.proj_out.weight', 'single_transformer_blocks.16.norm.linear.weight', 'transformer_blocks.4.ff.net.2.bias', 'single_transformer_blocks.10.proj_out.bias', 'single_transformer_blocks.12.proj_mlp.bias', 'transformer_blocks.0.ff.net.2.weight', 'single_transformer_blocks.8.attn.to_q.weight', 'single_transformer_blocks.18.proj_out.weight', 'single_transformer_blocks.1.attn.to_k.bias', 'single_transformer_blocks.0.attn.to_v.weight', 'single_transformer_blocks.17.attn.to_k.weight', 'single_transformer_blocks.13.proj_mlp.weight', 'single_transformer_blocks.12.attn.to_q.bias', 'single_transformer_blocks.6.attn.to_v.bias', 'transformer_blocks.4.ff_context.net.2.bias', 'transformer_blocks.3.attn.to_add_out.bias', 'single_transformer_blocks.9.norm.linear.bias', 'transformer_blocks.3.ff_context.net.2.bias', 'transformer_blocks.4.ff_context.net.0.proj.bias', 'single_transformer_blocks.0.attn.to_k.weight', 'single_transformer_blocks.15.attn.to_q.weight', 'single_transformer_blocks.4.proj_mlp.bias', 'single_transformer_blocks.6.norm.linear.weight', 'transformer_blocks.3.norm1_context.linear.weight', 'single_transformer_blocks.2.attn.to_q.weight', 'transformer_blocks.0.ff_context.net.2.bias', 'single_transformer_blocks.5.norm.linear.bias', 'single_transformer_blocks.8.proj_mlp.bias', 'transformer_blocks.1.attn.add_q_proj.bias', 'transformer_blocks.4.attn.to_out.0.bias', 'single_transformer_blocks.0.attn.to_v.bias', 'single_transformer_blocks.5.norm.linear.weight', 'single_transformer_blocks.6.norm.linear.bias', 'single_transformer_blocks.8.attn.to_k.weight', 'single_transformer_blocks.3.proj_out.bias', 'single_transformer_blocks.15.proj_mlp.weight', 'transformer_blocks.2.attn.to_q.bias', 'single_transformer_blocks.3.attn.to_k.bias', 'single_transformer_blocks.13.norm.linear.bias', 'single_transformer_blocks.0.norm.linear.weight', 'transformer_blocks.2.attn.add_q_proj.bias', 'single_transformer_blocks.10.norm.linear.weight', 'transformer_blocks.3.attn.to_v.bias', 'single_transformer_blocks.15.norm.linear.bias', 'single_transformer_blocks.3.attn.to_q.weight', 'transformer_blocks.2.ff.net.0.proj.weight', 'single_transformer_blocks.11.attn.to_q.weight', 'transformer_blocks.4.ff_context.net.0.proj.weight', 'single_transformer_blocks.15.attn.to_k.bias', 'single_transformer_blocks.0.proj_out.weight', 'single_transformer_blocks.0.attn.to_q.weight', 'single_transformer_blocks.11.norm.linear.bias', 'single_transformer_blocks.7.attn.to_q.bias', 'single_transformer_blocks.3.attn.to_v.bias', 'single_transformer_blocks.12.proj_mlp.weight', 'single_transformer_blocks.16.proj_mlp.weight', 'x_embedder.bias', 'time_text_embed.timestep_embedder.linear_2.weight', 'single_transformer_blocks.13.norm.linear.weight', 'single_transformer_blocks.12.proj_out.weight', 'single_transformer_blocks.7.attn.to_v.weight', 'transformer_blocks.3.ff.net.0.proj.weight', 'transformer_blocks.0.norm1.linear.bias', 'single_transformer_blocks.15.attn.to_q.bias', 'single_transformer_blocks.7.norm.linear.weight', 'single_transformer_blocks.3.proj_out.weight', 'single_transformer_blocks.10.attn.to_v.bias', 'time_text_embed.text_embedder.linear_1.bias', 'transformer_blocks.3.ff_context.net.2.weight', 'single_transformer_blocks.14.norm.linear.weight', 'single_transformer_blocks.10.norm.linear.bias', 'single_transformer_blocks.12.attn.to_k.weight', 'transformer_blocks.3.norm1_context.linear.bias', 'single_transformer_blocks.16.attn.to_v.bias', 'single_transformer_blocks.19.norm.linear.weight', 'transformer_blocks.1.ff.net.0.proj.bias', 'single_transformer_blocks.7.proj_out.bias', 'single_transformer_blocks.8.attn.to_q.bias', 'transformer_blocks.0.ff_context.net.0.proj.bias', 'single_transformer_blocks.6.attn.to_v.weight', 'single_transformer_blocks.17.attn.to_k.bias', 'single_transformer_blocks.10.proj_mlp.bias', 'single_transformer_blocks.19.attn.to_q.weight', 'single_transformer_blocks.11.attn.to_q.bias', 'transformer_blocks.0.ff_context.net.2.weight', 'single_transformer_blocks.6.attn.to_q.weight', 'single_transformer_blocks.8.norm.linear.bias', 'single_transformer_blocks.17.proj_out.bias', 'single_transformer_blocks.10.attn.to_k.bias', 'single_transformer_blocks.7.attn.to_v.bias', 'single_transformer_blocks.6.attn.to_k.weight', 'transformer_blocks.1.ff_context.net.2.bias', 'single_transformer_blocks.5.proj_mlp.bias', 'transformer_blocks.0.attn.to_v.bias', 'transformer_blocks.2.ff_context.net.2.bias', 'single_transformer_blocks.8.norm.linear.weight', 'single_transformer_blocks.6.proj_out.weight', 'transformer_blocks.2.norm1_context.linear.weight', 'single_transformer_blocks.17.attn.to_v.weight', 'single_transformer_blocks.18.attn.to_v.weight', 'single_transformer_blocks.19.norm.linear.bias', 'transformer_blocks.1.ff_context.net.2.weight', 'transformer_blocks.1.ff.net.2.bias', 'transformer_blocks.1.ff.net.0.proj.weight', 'transformer_blocks.1.norm1.linear.weight', 'single_transformer_blocks.1.proj_mlp.weight', 'transformer_blocks.4.ff_context.net.2.weight', 'single_transformer_blocks.6.proj_mlp.weight', 'single_transformer_blocks.13.attn.to_v.weight', 'single_transformer_blocks.19.attn.to_q.bias', 'single_transformer_blocks.17.proj_out.weight', 'transformer_blocks.3.ff_context.net.0.proj.weight', 'transformer_blocks.3.ff.net.2.bias', 'single_transformer_blocks.2.proj_mlp.bias', 'single_transformer_blocks.12.attn.to_k.bias', 'transformer_blocks.4.attn.add_k_proj.bias', 'context_embedder.bias', 'single_transformer_blocks.9.attn.to_v.bias', 'single_transformer_blocks.5.attn.to_q.bias', 'single_transformer_blocks.10.attn.to_q.bias', 'transformer_blocks.2.attn.add_v_proj.bias', 'transformer_blocks.2.norm1.linear.weight', 'single_transformer_blocks.17.norm.linear.bias', 'transformer_blocks.0.ff_context.net.0.proj.weight', 'single_transformer_blocks.10.proj_out.weight', 'single_transformer_blocks.2.norm.linear.weight', 'single_transformer_blocks.11.attn.to_k.bias', 'single_transformer_blocks.5.proj_out.bias', 'single_transformer_blocks.1.proj_mlp.bias', 'single_transformer_blocks.18.attn.to_k.weight', 'single_transformer_blocks.16.attn.to_v.weight', 'single_transformer_blocks.5.proj_mlp.weight', 'time_text_embed.timestep_embedder.linear_1.weight', 'single_transformer_blocks.15.norm.linear.weight', 'single_transformer_blocks.15.attn.to_v.weight', 'single_transformer_blocks.13.attn.to_v.bias', 'single_transformer_blocks.16.proj_out.bias', 'single_transformer_blocks.4.attn.to_v.bias', 'transformer_blocks.2.attn.add_k_proj.bias', 'single_transformer_blocks.16.attn.to_q.weight', 'single_transformer_blocks.11.attn.to_v.weight', 'single_transformer_blocks.5.attn.to_v.bias', 'single_transformer_blocks.17.attn.to_q.bias', 'single_transformer_blocks.18.attn.to_v.bias', 'single_transformer_blocks.14.attn.to_q.weight', 'single_transformer_blocks.2.attn.to_v.bias', 'single_transformer_blocks.11.proj_mlp.bias', 'single_transformer_blocks.13.proj_out.bias', 'single_transformer_blocks.9.proj_out.weight', 'single_transformer_blocks.5.attn.to_k.bias', 'single_transformer_blocks.18.attn.to_q.weight', 'single_transformer_blocks.4.proj_out.bias', 'time_text_embed.timestep_embedder.linear_2.bias', 'single_transformer_blocks.4.attn.to_v.weight', 'single_transformer_blocks.9.proj_out.bias', 'single_transformer_blocks.18.proj_mlp.bias', 'single_transformer_blocks.19.proj_out.weight', 'single_transformer_blocks.9.attn.to_v.weight', 'single_transformer_blocks.6.proj_out.bias', 'single_transformer_blocks.19.proj_mlp.weight', 'single_transformer_blocks.2.proj_out.bias', 'transformer_blocks.3.norm1.linear.bias', 'single_transformer_blocks.18.norm.linear.weight', 'single_transformer_blocks.4.norm.linear.bias', 'single_transformer_blocks.18.proj_out.bias', 'transformer_blocks.3.attn.add_v_proj.bias', 'transformer_blocks.4.attn.to_add_out.bias', 'single_transformer_blocks.10.attn.to_v.weight', 'single_transformer_blocks.14.proj_out.bias', 'norm_out.linear.bias', 'single_transformer_blocks.5.proj_out.weight', 'transformer_blocks.3.ff_context.net.0.proj.bias', 'single_transformer_blocks.1.proj_out.weight', 'transformer_blocks.4.attn.add_v_proj.bias', 'single_transformer_blocks.15.attn.to_k.weight', 'single_transformer_blocks.1.attn.to_k.weight', 'single_transformer_blocks.8.proj_out.weight', 'transformer_blocks.0.ff.net.2.bias', 'transformer_blocks.2.ff_context.net.2.weight', 'transformer_blocks.4.attn.add_q_proj.bias', 'transformer_blocks.0.norm1_context.linear.weight', 'transformer_blocks.4.ff.net.0.proj.weight', 'single_transformer_blocks.19.proj_out.bias', 'single_transformer_blocks.12.norm.linear.weight', 'transformer_blocks.1.attn.to_add_out.bias', 'single_transformer_blocks.16.norm.linear.bias', 'transformer_blocks.1.norm1_context.linear.bias', 'transformer_blocks.2.ff.net.2.weight', 'single_transformer_blocks.2.attn.to_q.bias', 'transformer_blocks.4.norm1_context.linear.weight', 'single_transformer_blocks.0.attn.to_q.bias', 'transformer_blocks.3.ff.net.0.proj.bias', 'single_transformer_blocks.4.norm.linear.weight', 'time_text_embed.text_embedder.linear_2.bias', 'single_transformer_blocks.9.proj_mlp.weight', 'single_transformer_blocks.6.attn.to_k.bias', 'single_transformer_blocks.10.proj_mlp.weight', 'single_transformer_blocks.2.attn.to_k.weight', 'single_transformer_blocks.13.attn.to_q.bias', 'single_transformer_blocks.3.attn.to_q.bias', 'proj_out.bias', 'time_text_embed.text_embedder.linear_2.weight', 'single_transformer_blocks.4.attn.to_k.weight', 'transformer_blocks.1.attn.to_out.0.bias', 'single_transformer_blocks.15.attn.to_v.bias', 'time_text_embed.text_embedder.linear_1.weight', 'transformer_blocks.2.ff.net.0.proj.bias', 'single_transformer_blocks.17.proj_mlp.bias', 'single_transformer_blocks.13.attn.to_k.bias', 'transformer_blocks.1.attn.to_q.bias', 'single_transformer_blocks.8.proj_out.bias', 'single_transformer_blocks.4.attn.to_q.bias', 'single_transformer_blocks.14.attn.to_k.bias', 'single_transformer_blocks.1.norm.linear.bias', 'single_transformer_blocks.18.proj_mlp.weight', 'transformer_blocks.4.norm1.linear.bias', 'single_transformer_blocks.7.attn.to_k.weight', 'single_transformer_blocks.11.proj_out.bias', 'single_transformer_blocks.1.attn.to_v.bias', 'single_transformer_blocks.8.attn.to_v.weight', 'single_transformer_blocks.3.norm.linear.bias', 'single_transformer_blocks.4.proj_mlp.weight', 'single_transformer_blocks.12.norm.linear.bias', 'single_transformer_blocks.6.attn.to_q.bias', 'single_transformer_blocks.16.proj_mlp.bias', 'single_transformer_blocks.1.attn.to_q.bias']\n", "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n" ] }, { "output_type": "error", "ename": "NotImplementedError", "evalue": "Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m/tmp/ipykernel_14456/960775828.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0;31m# Load transformer with safer parameters\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 23\u001b[0;31m transformer = FluxTransformer2DModel.from_pretrained(\n\u001b[0m\u001b[1;32m 24\u001b[0m \u001b[0mMODEL_ID\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0msubfolder\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"transformer\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py\u001b[0m in \u001b[0;36m_inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0mkwargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msmoothly_deprecate_legacy_arguments\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn_name\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 89\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_inner_fn\u001b[0m \u001b[0;31m# type: ignore\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/modeling_utils.py\u001b[0m in \u001b[0;36mfrom_pretrained\u001b[0;34m(cls, pretrained_model_name_or_path, **kwargs)\u001b[0m\n\u001b[1;32m 1419\u001b[0m \u001b[0;34m\"offload_index\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0moffload_index\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1420\u001b[0m }\n\u001b[0;32m-> 1421\u001b[0;31m \u001b[0mdispatch_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mdevice_map_kwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1422\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1423\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhf_quantizer\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/accelerate/big_modeling.py\u001b[0m in \u001b[0;36mdispatch_model\u001b[0;34m(model, device_map, main_device, state_dict, offload_dir, offload_index, offload_buffers, skip_keys, preload_module_classes, force_hooks)\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"neuron:{device}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 511\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdevice\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;34m\"disk\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 512\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 513\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 514\u001b[0m raise ValueError(\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/diffusers/models/modeling_utils.py\u001b[0m in \u001b[0;36mto\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1526\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1527\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1528\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1529\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1530\u001b[0m \u001b[0;31m# Taken from `transformers`.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36mto\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1379\u001b[0m \u001b[0;32mraise\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1380\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1381\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconvert\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1382\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1383\u001b[0m def register_full_backward_pre_hook(\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 931\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrecurse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 932\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchildren\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 933\u001b[0;31m \u001b[0mmodule\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 934\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 935\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_subclasses\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfake_tensor\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mFakeTensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_apply\u001b[0;34m(self, fn, recurse)\u001b[0m\n\u001b[1;32m 962\u001b[0m \u001b[0;31m# `with torch.no_grad():`\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 963\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mno_grad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 964\u001b[0;31m \u001b[0mparam_applied\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparam\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 965\u001b[0m \u001b[0mp_should_use_set_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcompute_should_use_set_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparam\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparam_applied\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 966\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36mconvert\u001b[0;34m(t)\u001b[0m\n\u001b[1;32m 1372\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mNotImplementedError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1373\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"Cannot copy out of meta tensor; no data!\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1374\u001b[0;31m raise NotImplementedError(\n\u001b[0m\u001b[1;32m 1375\u001b[0m \u001b[0;34mf\"{e} Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() \"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1376\u001b[0m \u001b[0;34mf\"when moving module from meta to a different device.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mNotImplementedError\u001b[0m: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device." ] } ] }, { "cell_type": "code", "source": [ "# =============================================================================\n", "# CELL 4: Warmup + Real Test\n", "# =============================================================================\n", "\n", "print(\"🔥 Running warmup inference...\")\n", "dummy1 = Image.new(\"RGB\", (768, 768), color=(120, 120, 120))\n", "dummy2 = Image.new(\"RGB\", (768, 768), color=(90, 90, 90))\n", "\n", "_ = dual_pipe(\n", " image1=dummy1,\n", " image2=dummy2,\n", " num_inference_steps=4,\n", " guidance_scale=1.5 if LOWER_GUIDANCE_FOR_TEST else 3.5,\n", " generator=torch.Generator(\"cuda\").manual_seed(42)\n", ")\n", "\n", "print(\"\\n=== Warmup complete. Running real test ===\")\n", "\n", "img1 = Image.new(\"RGB\", (1024, 1024), color=(128, 128, 128))\n", "img2 = Image.new(\"RGB\", (1024, 1024), color=(100, 100, 100))\n", "\n", "result = dual_pipe(\n", " image1=img1,\n", " image2=img2,\n", " num_inference_steps=4,\n", " guidance_scale=3.5,\n", " generator=torch.Generator(\"cuda\").manual_seed(123)\n", ")\n", "\n", "result.images[0].save(\"edited_1.png\")\n", "result.images[1].save(\"edited_2.png\")\n", "print(\"✅ Images saved as edited_1.png and edited_2.png\")" ], "metadata": { "id": "keM8zUw0_d9W" }, "execution_count": null, "outputs": [] } ] }