



  

<!DOCTYPE html>
<html
  lang="en"
  
  data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
  data-a11y-animated-images="system" data-a11y-link-underlines="true"
  
  >




  <head>
    <meta charset="utf-8">
  <link rel="dns-prefetch" href="https://github.githubassets.com">
  <link rel="dns-prefetch" href="https://avatars.githubusercontent.com">
  <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
  <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
  <link rel="preconnect" href="https://github.githubassets.com" crossorigin>
  <link rel="preconnect" href="https://avatars.githubusercontent.com">

<script type="importmap">{"imports":{"react":"https://github.githubassets.com/assets/react-e27d1b3e03961e68.js","react-dom":"https://github.githubassets.com/assets/react-dom-e5fd46a22d5c4058.js","react-dom/client":"https://github.githubassets.com/assets/react-dom-client-1b4a3ee065998cea.js","react-is":"https://github.githubassets.com/assets/react-is-e0b593954b4706d8.js","react-reconciler":"https://github.githubassets.com/assets/react-reconciler-8e99e505c4429605.js","react/compiler-runtime":"https://github.githubassets.com/assets/react-compiler-runtime-4610bd6d3de9c049.js","react/jsx-dev-runtime":"https://github.githubassets.com/assets/react-jsx-dev-runtime-ea55d68667d559e5.js","react/jsx-runtime":"https://github.githubassets.com/assets/react-jsx-runtime-4915cb0f5b3aff04.js","scheduler":"https://github.githubassets.com/assets/scheduler-58b860b049ca307c.js"}}</script>
<meta name="react-profiling" content="0" data-turbo-transient="true" />
<meta name="react-import-map" content="react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@777f63f87cd0" data-turbo-track="reload" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-e27d1b3e03961e68.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-compiler-runtime-4610bd6d3de9c049.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/scheduler-58b860b049ca307c.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-dom-e5fd46a22d5c4058.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-dom-client-1b4a3ee065998cea.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-is-e0b593954b4706d8.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-jsx-runtime-4915cb0f5b3aff04.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-reconciler-8e99e505c4429605.js" />

  


  <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-99f877e9ddfc0e51.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light_high_contrast-48fdd0811afbab3c.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-79ad2ace604703b3.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark_high_contrast-24484a076f02295f.css" /><link data-color-theme="light" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light-99f877e9ddfc0e51.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-48fdd0811afbab3c.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f4bf1142976e4bbf.css" /><link data-color-theme="light_colorblind_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind_high_contrast-f661b49995ba0bd8.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-0b38d22346321c92.css" /><link data-color-theme="light_tritanopia_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia_high_contrast-f1c62c9e70259b9f.css" /><link data-color-theme="dark" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark-79ad2ace604703b3.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-24484a076f02295f.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-f50cacf0a86b9929.css" /><link data-color-theme="dark_colorblind_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind_high_contrast-e61d4f4ca17852c2.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-39c10993d5603fac.css" /><link data-color-theme="dark_tritanopia_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia_high_contrast-73236c840c0c7d90.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-0de76f07cc035b10.css" /><link data-color-theme="dark_dimmed_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed_high_contrast-fd1500c8744e40d6.css" />

  <style type="text/css">
    :root {
      --tab-size-preference: 4;
    }

    pre, code {
      tab-size: var(--tab-size-preference);
    }
  </style>

    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-ed9ca172356fd545.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-1d2c7f7b52a6068b.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-54ba76e934a49d7c.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-88fc7764b4deb69a.css" />
  <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-11ee8a031c040c1a.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-2d56bdb0166c0238.css" />

  

  <script type="application/json" id="client-env">{"locale":"en","featureFlags":["actions_enable_background_steps","actions_new_hosted_runner_image_select_sizes_and_versions","activity_diff_file_tree","activity_repos_file_tree","activity_repos_overview_header","activity_repos_overview_sidebar","agent_author_search_expansion","agent_author_search_expansion_ui_pulls","alternate_user_config_repo","async_conversion_coverage_enabled","billing_billable_licenses_cost_center_bucket_fix","billing_budget_expiration","billing_cost_center_list_assigned_resources","billing_discount_threshold_notification","cca_show_aic_usage_per_session","code_quality_enablement_banner_targeting","code_quality_remove_preview","code_view_raf_sticky_lines","codespaces_prebuild_region_target_update","coding_agent_third_party_model_ui","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_automations_pagination","copilot_chat_clear_model_selection_for_default_change","copilot_chat_compact_tables","copilot_chat_header_reorder","copilot_chat_max_upsell","copilot_chat_minimize_contextual","copilot_chat_model_picker_promotions","copilot_chat_models_browser_cache","copilot_chat_new_topic_nudge","copilot_chat_reduce_quota_checks","copilot_chat_vision_dotcom_chat_ga_gate","copilot_chat_vision_preview_gate","copilot_css_textarea_autosize","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_removal_on_marketplace","copilot_fix_failed_workflows_all_skus","copilot_ftp_hyperspace_upgrade_prompt","copilot_hide_hovercard","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_suggestion_pills","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_agent_merge_fix_ci","copilot_mission_control_agent_merge_resolve_conflicts","copilot_mission_control_agents_repository_enablement","copilot_mission_control_early_stop","copilot_mission_control_environment_list_icons","copilot_mission_control_managed_sandbox_environments","copilot_mission_control_needs_attention","copilot_mission_control_reasoning_effort","copilot_mission_control_repo_hovercards","copilot_mission_control_sandbox_client_side_clone","copilot_mission_control_sandbox_remote_bypass","copilot_mission_control_session_filters","copilot_mission_control_task_alive_updates","copilot_mission_control_task_sharing","copilot_org_policy_page_focus_mode","copilot_pr_chat_enhancements","copilot_prominent_upgrade_button","copilot_resource_panel","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_authorization_status_ui","copilot_swe_agent_automation_resource_scoped_writes","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_issue_comment_trigger","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_pull_request_comment_trigger","copilot_swe_agent_pull_request_merged_trigger","copilot_swe_agent_pull_request_opened_trigger","copilot_swe_agent_pull_request_synchronize_trigger","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_task_scoped_alive_channel","copilot_token_based_billing","copilot_unconfigured_is_inherited","copilot_user_can_upgrade_plan_field","copilot_workbench_sunset","copilot_workbench_sunset_redirect","copilot_workbench_ubb","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","flex_suite_disable_river_accordion_dither","glc_code_quality_repo_settings_workflow_config","hide_github_models_ui","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","in_product_messaging_datadog_monitoring","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_fields_multi_select","issue_inline_avatars","issue_pinned_views","issue_pinned_views_optimistic_updates","issue_relative_time_micro","issues_dashboard_sso_structured_errors","issues_expanded_file_types","issues_hide_closed_sub_issues","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","labels_archiving","labels_archiving_info","landing_pages_ninetailed","lifecycle_label_name_updates","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_lazy_hydrate_agent_tasks","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_queue_restricted_pushers_warning","merge_status_checks_refetch_dedupe","merge_status_header_feedback","oauth_authorize_clickjacking_protection","octocaptcha_origin_optimization","primer_react_css_anchor_positioning","primer_react_merged_forwarded_refs","prs_copilot_app_open_action","prs_css_anchor_positioning","pull_request_copilot_attribution_header","pull_request_overview_panel_edit_description","pull_request_persister","pull_request_stacks_feedback_dialog","pull_request_stacks_rebase_conflict_instructions","pull_request_virtualization_image_estimate","pull_request_virtualization_scroll_compensation","pull_request_virtualization_scroll_intent","pulls_dashboard_sidebar_layout","quick_search_lazy_suggestions","react_blob_isolate_code_lines","react_blob_ssr_content_visibility","react_data_router_tanstack_allowed","react_query_props_with_key","react_sandbox_future_tanstack","repo_app","repo_app_actions_workflows","repo_app_agents","repo_app_commits","repo_app_issues","repo_app_pull_requests","repo_app_turbo","repo_issues_sidebar_layout","repo_overview_ask_copilot","repo_pulls_dashboard_persistence","repos_contributors_limited_default_range","review_involves_filter","rule_ignored_file_paths","rulesets_actor_list_editor","sample_network_conn_type","security_center_artifact_filters_popover","see_who_reacted","semantic_similarity_duplicate_issue_detection","session_logs_ungroup_reasoning_text","set_sha256_on_repo_creation_form","site_banner_desktop_copilot_app","site_ghca_pixel_mona","site_github_app_ga_page","site_github_app_ga_page_highlight","site_github_app_mobile_native_share","site_global_banner_dev_days_attendee","site_global_banner_learn_copilot_sdk","site_global_nav_spark_models_removed","spark_prompt_secret_scanning","spark_server_connection_status","suggest_custom_property_values_copilot","suppress_automated_browser_vitals","swp_forms_disable_octocaptcha","thread_resolution_reason","ui_service_referrer_metrics","ui_service_staleness_detection","update_issue_suggestions","user_code_paste_ux","viewscreen_sandbox","warn_inaccessible_attachments","webp_support","workbench_store_readonly","react_import_map","react_import_map"],"githubDomain":"https://github.com","copilotApiOverrideUrl":"https://api.githubcopilot.com","cmcApiUrl":"https://api.github.com/cmc_internal/api"}</script>
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/high-contrast-cookie-e3d808ee18eb9784.js"></script>
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/wp-runtime-d36c2e96db74cee4.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/app-foundation-89338d13d121427c.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/app-runtime-d8e4e5512b66f1d2.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/fetch-utilities-ef80792c471f3488.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ser-564408e9198dff6d.js" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/environment-6c93cc570c2f2713.js" defer="defer"></script>
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/app-runtime.47a3599624d63f20.module.css" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/catalyst-86a8f5de995615f8.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/selector-observer-e88088f989b27670.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/relative-time-element-7cdf4e0db98b997c.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/by-6b3c07383371bf58.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ja9-36f036c13c2e3a4c.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/kw-866fd9513ae95106.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/r1-b075aab3204f32f9.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/jz5-7c5d1669717041f8.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/hj-5126390ff433704d.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/j05-dce4d588268f0f7e.js" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/github-elements-9136c3da72ef47e0.js" defer="defer"></script>
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/element-registry-5cfb4a22c59d1609.js" defer="defer"></script>
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/runtime-helpers-6df03a157bacbc44.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/aria-live-76b18916d0c8ec4d.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/hotkey-5109c77d7ac61078.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/react-core-29b8ffcaab7c3949.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/04-a76c47ec12c12e01.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ur-024971cb63acad59.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/4t-364e19c63d726e9a.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/6ny-c969fbae697a356f.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/yhq-3a209035a30b1a09.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/z1v-da5b33b877bfa358.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/wo-09f85d22a6c8931b.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/9y-81cfe57dc9040f3e.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/j0-41a4cf04cbd99503.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0p-81491ed0d9d666e2.js" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/behaviors-e86299772805b3b3.js" defer="defer"></script>
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/react-core.db13aa11eb5412b2.module.css" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/code-menu-a303bfa3d4af14c5.js" defer="defer"></script>
  
  <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/primer-react-050aafaffcbc0f54.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ncx-9a860680a5f230b9.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/j6-363f0ebf4f62f310.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/t7l-bf6f21d7e7a43c35.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/fe-7576d9b281e2106a.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/wsr-5fd3071e5a9061ab.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0n-ecadb2ffe6b01ba2.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/xv-51cb34754bda73a9.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/n4u-6317ce1c31aed1db.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/j8s-d05eedc69cebc200.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/la-de176c4ee471f2b3.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/pa9-63a2449f68fddcc9.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/qk-69b7a09c43e10e06.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/6ko-674c1ec5588e9f0f.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/nsi-926ffbc13301c5b7.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/mgq-93f58f229b2328b4.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/on-75d8015f7c16be87.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/bi0-e2f78de823e39ca9.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/b1-1dbc371cef78c3c1.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0l-60a7083fe8307476.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/c2z-c92998400310b94b.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/f9-038758dcbfe08dab.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0k-b7df0a74912a42bf.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/sp-2bbb73a69162e23b.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/og-93ae8b358505d372.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/q5-fc1f2b54f1d10663.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ec-ec74cb1fa6c31a3f.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/du-bbe0f39cd2abe9a0.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ql0-6accb9e40c25a6a5.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/20-32a6db98bc57337d.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/dsj-4cca625a20b72565.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/wp-9f5235d335ab624b.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/e84-4da7096eb6b55d6d.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0pz-90009c6b3d9415c6.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/7mh-77fafa8751caee98.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/bsb-4f4ac8c20da73fac.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/46-90fb1c98afc2cd5a.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/jga-3f6576d6f86d4e43.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/ax-0ad16095945fc6f4.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/0dh-eb608edac481e761.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/xc-f5d51b571cd317cb.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/7cv-33c444fbc72b9998.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/4b-c63a3f3820a90d31.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/qv-bdafe2897b1bc43a.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/gtp-0eb27f0896440617.js" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/code-view-a4ab686d375b875c.js" defer="defer"></script>
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react-css.7c5f404947919942.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/ql0.bd9e6b542f167fd8.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/46.3e560835284be460.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/xc.13e027137438fd9f.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/4b.e524e9f270f17ecc.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/qv.1bac5eeb7156cd97.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-view.f3937ee8717738ed.module.css" />

  <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/hu-1fc0b2a167afc025.js" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/uul-06c73d3dea5f5318.js" />
<script crossorigin="anonymous" type="module" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-9cdb71a0a0f38218.js" defer="defer"></script>
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react-css.7c5f404947919942.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.89410a16a27828fc.module.css" />


  <title>maxdiffusion/README.md at main · AI-Hypercomputer/maxdiffusion · GitHub</title>



  <meta name="route-pattern" content="/:user_id/:repository/blob/*name(/*path)" data-turbo-transient>
  <meta name="route-controller" content="blob" data-turbo-transient>
  <meta name="route-action" content="show" data-turbo-transient>
  <meta name="fetch-nonce" content="v2:e40163cf-fe48-415a-3bf7-a6d8a2023c9c">

    
  <meta name="current-catalog-service-hash" content="f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb">


  <meta name="request-id" content="C672:32F50:15ABA9:12E350:6AA970F7" data-pjax-transient="true"/><meta name="html-safe-nonce" content="253c64eb2a3ac977b0cd2ec328495facfefce00c3ff2e77a230c8ba7d087e2ee" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjcyOjMyRjUwOjE1QUJBOToxMkUzNTA6NkFBOTcwRjciLCJ2aXNpdG9yX2lkIjoiNzQ1OTkyNzQwOTcyMTcwMDU5OSIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="c671a3ccb727c9f181c64a8ceef6fb2342be5ee0272ca502083daac2af21653c" data-pjax-transient="true"/>


    <meta name="hovercard-subject-tag" content="repository:693349437" data-turbo-transient>


  <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree,copilot" data-turbo-transient="true" />
  

  <meta name="selected-link" value="repo_source" data-turbo-transient>
  <link rel="assets" href="https://github.githubassets.com/">

    <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">

<meta name="octolytics-url" content="https://collector.github.com/github/collect" />





  <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-turbo-transient="true" />

  




    <meta name="user-login" content="">

  

    <meta name="viewport" content="width=device-width">

    

      <meta name="description" content="Contribute to AI-Hypercomputer/maxdiffusion development by creating an account on GitHub.">

      <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">

    <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
    <meta property="fb:app_id" content="1401488693436528">
    <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md" />

      <meta name="twitter:image" content="https://opengraph.githubassets.com/8f2e0f99a2cefebaec1d346b9481dc6b2e70fd725f51789c632c047e91a554f1/AI-Hypercomputer/maxdiffusion" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="maxdiffusion/README.md at main · AI-Hypercomputer/maxdiffusion" /><meta name="twitter:description" content="Contribute to AI-Hypercomputer/maxdiffusion development by creating an account on GitHub." />
  <meta property="og:image" content="https://opengraph.githubassets.com/8f2e0f99a2cefebaec1d346b9481dc6b2e70fd725f51789c632c047e91a554f1/AI-Hypercomputer/maxdiffusion" /><meta property="og:image:alt" content="Contribute to AI-Hypercomputer/maxdiffusion development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="maxdiffusion/README.md at main · AI-Hypercomputer/maxdiffusion" /><meta property="og:url" content="https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md" /><meta property="og:description" content="Contribute to AI-Hypercomputer/maxdiffusion development by creating an account on GitHub." />
  




      <meta name="hostname" content="github.com">



        <meta name="expected-hostname" content="github.com">


  <meta http-equiv="x-pjax-version" content="49be2262d587a131450d70b8d45705729e15f30adc7a49e415cbdfe189c0a7bd" data-turbo-track="reload">
  <meta http-equiv="x-pjax-csp-version" content="f2311ccc2e94cef09d9c62c8c090301d08823a2fd66b86a913b7d968c86acb1a" data-turbo-track="reload">
  <meta http-equiv="x-pjax-css-version" content="fd80f4397e6b366d79cd8ab0cc06c0f64e6a731ebf6ac8fbb538416234459325" data-turbo-track="reload">
  <meta http-equiv="x-pjax-js-version" content="0222d07c6e659b8819bcc5f0e4c766db7dd6b3235b5f8a6e4c5c6db4dfcf145e" data-turbo-track="reload">

  <meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">

      <meta name="turbo-cache-control" content="no-cache" data-turbo-transient>

    <meta data-hydrostats="publish">

  <meta name="go-import" content="github.com/AI-Hypercomputer/maxdiffusion git https://github.com/AI-Hypercomputer/maxdiffusion.git">

  <meta name="octolytics-dimension-user_id" content="181000646" /><meta name="octolytics-dimension-user_login" content="AI-Hypercomputer" /><meta name="octolytics-dimension-repository_id" content="693349437" /><meta name="octolytics-dimension-repository_nwo" content="AI-Hypercomputer/maxdiffusion" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="693349437" /><meta name="octolytics-dimension-repository_network_root_nwo" content="AI-Hypercomputer/maxdiffusion" />
  



    

    <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
  <meta name="disable-turbo" content="false">


  <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">


  <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">

  <meta name="release" content="8af1d6ddd7587673b31fc1e5e8eb3c4bc97d1cab" data-turbo-track="reload">
  <meta name="ui-target" content="full">

  <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000">
  <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png">
  <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon">

<meta name="theme-color" content="#1e2327">
<meta name="color-scheme" content="light dark" />


  <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">

  </head>

  <body class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
    <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
      <div id="__primerPortalRoot__" style="z-index: 1000; position: absolute; width: 100%;" data-turbo-permanent></div>
      

    <div class="position-relative header-wrapper js-header-wrapper ">
      <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 tmp-py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a>

      <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
    <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span>
</span>      
      <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/l7j-2ddd8b435dadae28.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-de8e6cab9dee9bea.js" fetchpriority="low" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react-css.7c5f404947919942.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/keyboard-shortcuts-dialog.0497dd4c65ae3400.module.css" />

<react-partial
  partial-name="keyboard-shortcuts-dialog"
  data-ssr="false"
  data-attempted-ssr="false"
  data-react-profiling="false"
>
  
  <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script>
  <div data-target="react-partial.reactRoot"></div>
</react-partial>





      

          

                <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/2l-cbdcab386be8ed25.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/i26-e41bee64286a7613.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/fz5-23f28c0f388769c9.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/lht-26506ea833dda5be.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/p1-76a75a6081059b19.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/3d-82c347d20a13fb90.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/tua-c4ca62c5e0e0318e.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/4s-0fa28f31e42d2b12.js" fetchpriority="low" />
<link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/marketing-header-894af0c99c741043.js" fetchpriority="low" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react-css.7c5f404947919942.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react-brand-css.6a01c236ff527e7e.module.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/4s.0475f8e2181c4fb1.module.css" />

<react-partial
  partial-name="marketing-header"
  data-ssr="true"
  data-attempted-ssr="true"
  data-react-profiling="false"
>
  
  <script type="application/json" data-target="react-partial.embeddedData">{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2Fgithub.com%2FAI-Hypercomputer%2Fmaxdiffusion%2Fblob%2Fmain%2FREADME.md","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow\u0026source=header-repo\u0026source_repo=AI-Hypercomputer%2Fmaxdiffusion","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md\",\"user_id\":null}}","auth_hydro_click_hmac":"9d1641343cb8d9c388e6fd3924252739cce41494cbf638d835d0bc56aec828ff","overlay":false,"fixed":false}}</script>
  <div data-target="react-partial.reactRoot"><div data-color-mode="dark" data-light-theme="light" data-dark-theme="dark"><header class="MarketingHeader-module__root__Tk7n3 HeaderMktg header-logged-out" role="banner" data-marketing-header="true" data-color-mode="dark" data-light-theme="light" data-dark-theme="dark" data-is-top="true"><h2 class="MarketingHeader-module__visuallyHidden__sqKsl">Navigation Menu</h2><button type="button" class="MarketingHeader-module__backdrop__sw4RU" aria-label="Close navigation menu"></button><div class="MarketingHeader-module__bar__mBSyE"><div class="MarketingHeader-module__topRow__yeury"><div class="MarketingHeader-module__toggleSlot__hDxbh"><button type="button" class="HeaderMenuToggle-module__toggle__i8EiC" aria-label="Toggle navigation" aria-expanded="false"><span class="HeaderMenuToggle-module__toggleBar__jVN0H"></span><span class="HeaderMenuToggle-module__toggleBar__jVN0H"></span><span class="HeaderMenuToggle-module__toggleBar__jVN0H"></span></button></div><a href="/" aria-label="Homepage" class="HeaderLogo-module__logo__UFyHI" data-analytics-event="{&quot;action&quot;:&quot;homepage&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;logo&quot;,&quot;location&quot;:&quot;header&quot;,&quot;label&quot;:&quot;homepage_link_logo_header&quot;}"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-mark-github" viewBox="0 0 24 24" width="32" height="32" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"></path></svg></a><div class="AuthCTAs-module__mobileActions__NNzeV"><a class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--subtle___F7pEE Primer_Brand__Button-module__Button--size-small___zQrEw AuthCTAs-module__cta__WpwQq" href="/login?return_to=https%3A%2F%2Fgithub.com%2FAI-Hypercomputer%2Fmaxdiffusion%2Fblob%2Fmain%2FREADME.md" data-analytics-event="{&quot;action&quot;:&quot;sign_in&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;auth_cta&quot;,&quot;location&quot;:&quot;header&quot;,&quot;label&quot;:&quot;sign_in_link_auth_cta_header&quot;}" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9d1641343cb8d9c388e6fd3924252739cce41494cbf638d835d0bc56aec828ff"><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-subtle___8ndWH">Sign in</span></span></a><button class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--subtle___F7pEE Primer_Brand__Button-module__Button--size-small___zQrEw HeaderAppearanceSettings-module__trigger__hUheK" type="button" aria-haspopup="dialog" aria-labelledby="_R_3dd_"><span class="Primer_Brand__Button-module__Button__leading-visual___jjtTe" data-testid="Button-leading-visual"><svg data-component="Octicon" focusable="false" aria-hidden="true" class="octicon octicon-sliders Primer_Brand__Button-module__Button__icon-visual____qybb" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M15 2.75a.75.75 0 0 1-.75.75h-4a.75.75 0 0 1 0-1.5h4a.75.75 0 0 1 .75.75Zm-8.5.75v1.25a.75.75 0 0 0 1.5 0v-4a.75.75 0 0 0-1.5 0V2H1.75a.75.75 0 0 0 0 1.5H6.5Zm1.25 5.25a.75.75 0 0 0 0-1.5h-6a.75.75 0 0 0 0 1.5h6ZM15 8a.75.75 0 0 1-.75.75H11.5V10a.75.75 0 1 1-1.5 0V6a.75.75 0 0 1 1.5 0v1.25h2.75A.75.75 0 0 1 15 8Zm-9 5.25v-2a.75.75 0 0 0-1.5 0v1.25H1.75a.75.75 0 0 0 0 1.5H4.5v1.25a.75.75 0 0 0 1.5 0v-2Zm9 0a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h6a.75.75 0 0 1 .75.75Z"></path></svg></span><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-subtle___8ndWH"></span></span></button><div class="Primer_Brand__Tooltip-module__Tooltip___0Eipx" data-direction="s" aria-hidden="true" id="_R_3dd_">Appearance settings</div></div></div><div class="MarketingHeader-module__menu__GIy3y"><div class="MarketingHeader-module__menuWrapper__owstH"><nav class="MarketingNavigation-module__nav__W0KYY" aria-label="Global"><ul class="MarketingNavigation-module__list__tFbMb"><li><div class="NavDropdown-module__container__l2YeI"><button type="button" class="NavDropdown-module__button__PEHWX" aria-expanded="false" aria-controls="_R_nd_">Platform<svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-right NavDropdown-module__buttonIcon__Tkl8_" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m6.427 4.427 3.396 3.396a.25.25 0 0 1 0 .354l-3.396 3.396A.25.25 0 0 1 6 11.396V4.604a.25.25 0 0 1 .427-.177Z"></path></svg></button><div id="_R_nd_" class="NavDropdown-module__dropdown__xm1jd"><ul class="NavDropdown-module__list__zuCgG"><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_5knd_">AI CODE CREATION</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_5knd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/copilot" data-analytics-event="{&quot;action&quot;:&quot;github_copilot&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_copilot_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copilot NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg>GitHub Copilot</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Write better code with AI</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/ai/github-app" data-analytics-event="{&quot;action&quot;:&quot;github_copilot_app&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_copilot_app_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-mark-github NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656"></path></svg>GitHub Copilot app</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Direct agents from issue to merge</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/mcp" data-analytics-event="{&quot;action&quot;:&quot;mcp_registry&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;mcp_registry_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-mcp NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M5.52 1.12a3.578 3.578 0 0 1 6.078 2.98 3.578 3.578 0 0 1 2.982 6.08l-3.292 3.293a.252.252 0 0 0 0 .354l.843.843a.749.749 0 1 1-1.06 1.06l-.844-.843a1.75 1.75 0 0 1 0-2.474L13.52 9.12a2.08 2.08 0 0 0 0-2.94 2.08 2.08 0 0 0-2.94 0L7.731 9.03A.75.75 0 0 1 6.67 7.97l2.85-2.85a2.08 2.08 0 0 0 0-2.94 2.08 2.08 0 0 0-2.94 0l-4.799 4.8A.75.75 0 0 1 .72 5.92Z"></path><path d="M7.52 3.12a.749.749 0 1 1 1.06 1.06L5.731 7.03A2.079 2.079 0 0 0 8.67 9.97l2.85-2.85a.749.749 0 1 1 1.06 1.06l-2.849 2.85A3.578 3.578 0 0 1 4.67 5.97Z"></path></svg>MCP Registry</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Integrate external tools</span></span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_9knd_">DEVELOPER WORKFLOWS</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_9knd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/actions" data-analytics-event="{&quot;action&quot;:&quot;actions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;actions_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-workflow NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path></svg>Actions</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Automate any workflow</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/codespaces" data-analytics-event="{&quot;action&quot;:&quot;codespaces&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;codespaces_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-codespaces NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg>Codespaces</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Instant dev environments</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/issues" data-analytics-event="{&quot;action&quot;:&quot;issues&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;issues_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-issue-opened NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg>Issues</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Plan and track work</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/code-review" data-analytics-event="{&quot;action&quot;:&quot;code_review&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;code_review_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-code NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg>Code Review</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Manage code changes</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/code-quality" data-analytics-event="{&quot;action&quot;:&quot;code_quality&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;code_quality_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-codescan-checkmark NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.28 6.28a.75.75 0 1 0-1.06-1.06L6.25 8.19l-.97-.97a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.06 0l3.5-3.5Z"></path><path d="M7.5 15a7.5 7.5 0 1 1 5.807-2.754l2.473 2.474a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2.474-2.473A7.472 7.472 0 0 1 7.5 15Zm0-13.5a6 6 0 1 0 4.094 10.386.748.748 0 0 1 .293-.292 6.002 6.002 0 0 0 1.117-6.486A6.002 6.002 0 0 0 7.5 1.5Z"></path></svg>Code Quality</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Enforce quality at merge</span></span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_dknd_">APPLICATION SECURITY</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_dknd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/security/advanced-security" data-analytics-event="{&quot;action&quot;:&quot;github_advanced_security&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_advanced_security_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-shield-check NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg>GitHub Advanced Security</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Find and fix vulnerabilities</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/security/advanced-security/code-security" data-analytics-event="{&quot;action&quot;:&quot;code_security&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;code_security_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-code-square NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg>Code security</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Secure your code as you build</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/security/advanced-security/secret-protection" data-analytics-event="{&quot;action&quot;:&quot;secret_protection&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;secret_protection_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-lock NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M4 4a4 4 0 0 1 8 0v2h.25c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25v-5.5C2 6.784 2.784 6 3.75 6H4Zm8.25 3.5h-8.5a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25ZM10.5 6V4a2.5 2.5 0 1 0-5 0v2Z"></path></svg>Secret protection</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Stop leaks before they start</span></span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ NavGroup-module__hasSeparator__FnMrN"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_hknd_">EXPLORE</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_hknd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/why-github" data-analytics-event="{&quot;action&quot;:&quot;why_github&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;why_github_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Why GitHub</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://docs.github.com" data-analytics-event="{&quot;action&quot;:&quot;documentation&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;documentation_link_platform_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Documentation</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://github.blog" data-analytics-event="{&quot;action&quot;:&quot;blog&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;blog_link_platform_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Blog</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://github.blog/changelog" data-analytics-event="{&quot;action&quot;:&quot;changelog&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;changelog_link_platform_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Changelog</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/marketplace" data-analytics-event="{&quot;action&quot;:&quot;marketplace&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;marketplace_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Marketplace</span></a></li></ul></div></li></ul><div class="NavDropdown-module__trailingLinkContainer__VgJGL"><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/features" data-analytics-event="{&quot;action&quot;:&quot;view_all_features&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;platform&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_features_link_platform_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all features</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></div></div></div></li><li><div class="NavDropdown-module__container__l2YeI"><button type="button" class="NavDropdown-module__button__PEHWX" aria-expanded="false" aria-controls="_R_17d_">Solutions<svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-right NavDropdown-module__buttonIcon__Tkl8_" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m6.427 4.427 3.396 3.396a.25.25 0 0 1 0 .354l-3.396 3.396A.25.25 0 0 1 6 11.396V4.604a.25.25 0 0 1 .427-.177Z"></path></svg></button><div id="_R_17d_" class="NavDropdown-module__dropdown__xm1jd"><ul class="NavDropdown-module__list__zuCgG"><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_5l7d_">BY COMPANY SIZE</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_5l7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/enterprise" data-analytics-event="{&quot;action&quot;:&quot;enterprises&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;enterprises_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Enterprises</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/team" data-analytics-event="{&quot;action&quot;:&quot;small_and_medium_teams&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;small_and_medium_teams_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Small and medium teams</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/enterprise/startups" data-analytics-event="{&quot;action&quot;:&quot;startups&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;startups_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Startups</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/industry/nonprofits" data-analytics-event="{&quot;action&quot;:&quot;nonprofits&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;nonprofits_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Nonprofits</span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_9l7d_">BY USE CASE</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_9l7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/use-case/app-modernization" data-analytics-event="{&quot;action&quot;:&quot;app_modernization&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;app_modernization_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">App Modernization</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/use-case/devsecops" data-analytics-event="{&quot;action&quot;:&quot;devsecops&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;devsecops_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">DevSecOps</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/use-case/devops" data-analytics-event="{&quot;action&quot;:&quot;devops&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;devops_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">DevOps</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/use-case/ci-cd" data-analytics-event="{&quot;action&quot;:&quot;ci/cd&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;ci/cd_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">CI/CD</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/solutions/use-case" data-analytics-event="{&quot;action&quot;:&quot;view_all_use_cases&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_use_cases_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all use cases</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_dl7d_">BY INDUSTRY</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_dl7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/industry/healthcare" data-analytics-event="{&quot;action&quot;:&quot;healthcare&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;healthcare_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Healthcare</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/industry/financial-services" data-analytics-event="{&quot;action&quot;:&quot;financial_services&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;financial_services_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Financial services</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/industry/manufacturing" data-analytics-event="{&quot;action&quot;:&quot;manufacturing&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;manufacturing_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Manufacturing</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/industry/government" data-analytics-event="{&quot;action&quot;:&quot;government&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;government_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Government</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/solutions/industry" data-analytics-event="{&quot;action&quot;:&quot;view_all_industries&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_industries_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all industries</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></li></ul></div></li></ul><div class="NavDropdown-module__trailingLinkContainer__VgJGL"><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/solutions" data-analytics-event="{&quot;action&quot;:&quot;view_all_solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_solutions_link_solutions_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all solutions</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></div></div></div></li><li><div class="NavDropdown-module__container__l2YeI"><button type="button" class="NavDropdown-module__button__PEHWX" aria-expanded="false" aria-controls="_R_1nd_">Resources<svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-right NavDropdown-module__buttonIcon__Tkl8_" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m6.427 4.427 3.396 3.396a.25.25 0 0 1 0 .354l-3.396 3.396A.25.25 0 0 1 6 11.396V4.604a.25.25 0 0 1 .427-.177Z"></path></svg></button><div id="_R_1nd_" class="NavDropdown-module__dropdown__xm1jd"><ul class="NavDropdown-module__list__zuCgG"><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_5lnd_">EXPLORE BY TOPIC</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_5lnd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/articles?topic=ai" data-analytics-event="{&quot;action&quot;:&quot;ai&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;ai_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">AI</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/articles?topic=software-development" data-analytics-event="{&quot;action&quot;:&quot;software_development&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;software_development_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Software Development</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/articles?topic=devops" data-analytics-event="{&quot;action&quot;:&quot;devops&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;devops_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">DevOps</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/articles?topic=security" data-analytics-event="{&quot;action&quot;:&quot;security&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;security_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Security</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/resources/articles" data-analytics-event="{&quot;action&quot;:&quot;view_all_topics&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_topics_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all topics</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_9lnd_">EXPLORE BY TYPE</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_9lnd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/customer-stories" data-analytics-event="{&quot;action&quot;:&quot;customer_stories&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;customer_stories_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Customer stories</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/events" data-analytics-event="{&quot;action&quot;:&quot;events__webinars&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;events__webinars_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Events &amp; webinars</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/resources/whitepapers" data-analytics-event="{&quot;action&quot;:&quot;ebooks__reports&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;ebooks__reports_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Ebooks &amp; reports</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/solutions/executive-insights" data-analytics-event="{&quot;action&quot;:&quot;business_insights&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;business_insights_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Business insights</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://skills.github.com" data-analytics-event="{&quot;action&quot;:&quot;github_skills&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_skills_link_resources_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">GitHub Skills</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_dlnd_">SUPPORT &amp; SERVICES</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_dlnd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://docs.github.com" data-analytics-event="{&quot;action&quot;:&quot;documentation&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;documentation_link_resources_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Documentation</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://support.github.com" data-analytics-event="{&quot;action&quot;:&quot;customer_support&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;customer_support_link_resources_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Customer support</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/orgs/community/discussions" data-analytics-event="{&quot;action&quot;:&quot;community_forum&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;community_forum_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Community forum</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/trust-center" data-analytics-event="{&quot;action&quot;:&quot;trust_center&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;trust_center_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Trust center</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/partners" data-analytics-event="{&quot;action&quot;:&quot;partners&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;partners_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Partners</span></a></li></ul></div></li></ul><div class="NavDropdown-module__trailingLinkContainer__VgJGL"><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--arrow-end___esdN8" href="https://github.com/resources" data-analytics-event="{&quot;action&quot;:&quot;view_all_resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;view_all_resources_link_resources_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">View all resources</span><svg class="Primer_Brand__ExpandableArrow-module__ExpandableArrow___aaZs9 Primer_Brand__Link-module__Link-arrow___yd78i" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path fill="currentColor" d="M7.28033 3.21967C6.98744 2.92678 6.51256 2.92678 6.21967 3.21967C5.92678 3.51256 5.92678 3.98744 6.21967 4.28033L7.28033 3.21967ZM11 8L11.5303 8.53033C11.8232 8.23744 11.8232 7.76256 11.5303 7.46967L11 8ZM6.21967 11.7197C5.92678 12.0126 5.92678 12.4874 6.21967 12.7803C6.51256 13.0732 6.98744 13.0732 7.28033 12.7803L6.21967 11.7197ZM6.21967 4.28033L10.4697 8.53033L11.5303 7.46967L7.28033 3.21967L6.21967 4.28033ZM10.4697 7.46967L6.21967 11.7197L7.28033 12.7803L11.5303 8.53033L10.4697 7.46967Z"></path><path class="Primer_Brand__ExpandableArrow-module__ExpandableArrow-stem___0K8Hz" stroke="currentColor" d="M1.75 8H11" stroke-width="1.5" stroke-linecap="round"></path></svg></a></div></div></div></li><li><div class="NavDropdown-module__container__l2YeI"><button type="button" class="NavDropdown-module__button__PEHWX" aria-expanded="false" aria-controls="_R_27d_">Open Source<svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-right NavDropdown-module__buttonIcon__Tkl8_" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m6.427 4.427 3.396 3.396a.25.25 0 0 1 0 .354l-3.396 3.396A.25.25 0 0 1 6 11.396V4.604a.25.25 0 0 1 .427-.177Z"></path></svg></button><div id="_R_27d_" class="NavDropdown-module__dropdown__xm1jd"><ul class="NavDropdown-module__list__zuCgG"><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_5m7d_">COMMUNITY</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_5m7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/open-source/sponsors" data-analytics-event="{&quot;action&quot;:&quot;github_sponsors&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_sponsors_link_open_source_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-sponsor-tiers NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.586 1C12.268 1 13.5 2.37 13.5 4.25c0 1.745-.996 3.359-2.622 4.831-.166.15-.336.297-.509.438l1.116 5.584a.75.75 0 0 1-.991.852l-2.409-.876a.25.25 0 0 0-.17 0l-2.409.876a.75.75 0 0 1-.991-.852L5.63 9.519a13.78 13.78 0 0 1-.51-.438C3.497 7.609 2.5 5.995 2.5 4.25 2.5 2.37 3.732 1 5.414 1c.963 0 1.843.403 2.474 1.073L8 2.198l.112-.125a3.385 3.385 0 0 1 2.283-1.068L10.586 1Zm-3.621 9.495-.718 3.594 1.155-.42a1.75 1.75 0 0 1 1.028-.051l.168.051 1.154.42-.718-3.592c-.199.13-.37.235-.505.314l-.169.097a.75.75 0 0 1-.72 0 9.54 9.54 0 0 1-.515-.308l-.16-.105ZM10.586 2.5c-.863 0-1.611.58-1.866 1.459-.209.721-1.231.721-1.44 0C7.025 3.08 6.277 2.5 5.414 2.5 4.598 2.5 4 3.165 4 4.25c0 1.23.786 2.504 2.128 3.719.49.443 1.018.846 1.546 1.198l.325.21.076-.047.251-.163a13.341 13.341 0 0 0 1.546-1.198C11.214 6.754 12 5.479 12 4.25c0-1.085-.598-1.75-1.414-1.75Z"></path></svg>GitHub Sponsors</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Fund open source developers</span></span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_9m7d_">PROGRAMS</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_9m7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://securitylab.github.com" data-analytics-event="{&quot;action&quot;:&quot;security_lab&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;security_lab_link_open_source_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Security Lab</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://maintainers.github.com" data-analytics-event="{&quot;action&quot;:&quot;maintainer_community&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;maintainer_community_link_open_source_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Maintainer Community</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://stars.github.com" data-analytics-event="{&quot;action&quot;:&quot;github_stars&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_stars_link_open_source_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">GitHub Stars</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 Primer_Brand__Link-module__Link--is-external___xsncV" href="https://archiveprogram.github.com" data-analytics-event="{&quot;action&quot;:&quot;archive_program&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;archive_program_link_open_source_navbar&quot;}" target="_blank" rel="noreferrer"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Archive Program</span><svg data-component="Octicon" focusable="false" aria-label="External link" class="octicon octicon-link-external" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_dm7d_">REPOSITORIES</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_dm7d_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/topics" data-analytics-event="{&quot;action&quot;:&quot;topics&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;topics_link_open_source_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Topics</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/trending" data-analytics-event="{&quot;action&quot;:&quot;trending&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;trending_link_open_source_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Trending</span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0" href="https://github.com/collections" data-analytics-event="{&quot;action&quot;:&quot;collections&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;collections_link_open_source_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty">Collections</span></a></li></ul></div></li></ul></div></div></li><li><div class="NavDropdown-module__container__l2YeI"><button type="button" class="NavDropdown-module__button__PEHWX" aria-expanded="false" aria-controls="_R_2nd_">Enterprise<svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-right NavDropdown-module__buttonIcon__Tkl8_" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m6.427 4.427 3.396 3.396a.25.25 0 0 1 0 .354l-3.396 3.396A.25.25 0 0 1 6 11.396V4.604a.25.25 0 0 1 .427-.177Z"></path></svg></button><div id="_R_2nd_" class="NavDropdown-module__dropdown__xm1jd"><ul class="NavDropdown-module__list__zuCgG"><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_5mnd_">ENTERPRISE SOLUTIONS</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_5mnd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/enterprise" data-analytics-event="{&quot;action&quot;:&quot;enterprise_platform&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;enterprise_platform_link_enterprise_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-stack NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.122.392a1.75 1.75 0 0 1 1.756 0l5.003 2.902c.83.481.83 1.68 0 2.162L8.878 8.358a1.75 1.75 0 0 1-1.756 0L2.119 5.456a1.251 1.251 0 0 1 0-2.162ZM8.125 1.69a.248.248 0 0 0-.25 0l-4.63 2.685 4.63 2.685a.248.248 0 0 0 .25 0l4.63-2.685ZM1.601 7.789a.75.75 0 0 1 1.025-.273l5.249 3.044a.248.248 0 0 0 .25 0l5.249-3.044a.75.75 0 0 1 .752 1.298l-5.248 3.044a1.75 1.75 0 0 1-1.756 0L1.874 8.814A.75.75 0 0 1 1.6 7.789Zm0 3.5a.75.75 0 0 1 1.025-.273l5.249 3.044a.248.248 0 0 0 .25 0l5.249-3.044a.75.75 0 0 1 .752 1.298l-5.248 3.044a1.75 1.75 0 0 1-1.756 0l-5.248-3.044a.75.75 0 0 1-.273-1.025Z"></path></svg>Enterprise platform</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">AI-powered developer platform</span></span></a></li></ul></div></li><li><div class="NavGroup-module__group__W8SqJ"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--monospace___QXHDQ Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavGroup-module__title__Wzxz2" id="_R_9mnd_">AVAILABLE ADD-ONS</span><ul class="NavGroup-module__list__UCOFy" aria-labelledby="_R_9mnd_"><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/security/advanced-security" data-analytics-event="{&quot;action&quot;:&quot;github_advanced_security&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;github_advanced_security_link_enterprise_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-shield-check NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg>GitHub Advanced Security</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Enterprise-grade security features</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/features/copilot/copilot-business" data-analytics-event="{&quot;action&quot;:&quot;copilot_for_business&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;copilot_for_business_link_enterprise_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copilot NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg>Copilot for Business</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Enterprise-grade AI features</span></span></a></li><li><a class="Primer_Brand__Link-module__Link___lF11y Primer_Brand__Link-module__Link--default___VRVW0 NavLink-module__link__EG3d4" href="https://github.com/enterprise/premium-support" data-analytics-event="{&quot;action&quot;:&quot;premium_support&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;premium_support_link_enterprise_navbar&quot;}"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Link-module__Link--label___jM8Ty"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS Primer_Brand__Text-module__Text--weight-medium___qJKf_ NavLink-module__title__Q7t0p"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-comment-discussion NavLink-module__icon__ltGNM" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path></svg>Premium Support</span><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--muted___rE6mh Primer_Brand__Text-module__Text--200____P1wy Primer_Brand__Text-module__Text--antialiased___TYoXS NavLink-module__subtitle__X4gkW">Enterprise-grade 24/7 support</span></span></a></li></ul></div></li></ul></div></div></li><li><a href="https://github.com/pricing" data-analytics-event="{&quot;action&quot;:&quot;pricing&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;pricing&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;pricing_link_pricing_navbar&quot;}" class="MarketingNavigation-module__navLink__hUomM">Pricing</a></li></ul></nav><div class="MarketingHeader-module__ctaContainer__tBmPz"><div class="HeaderSearch-module__searchSlot__oVOUS"><button class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--subtle___F7pEE Primer_Brand__Button-module__Button--size-small___zQrEw HeaderSearch-module__trigger__zsF9q" type="button" aria-haspopup="dialog" aria-expanded="false" aria-label="Search or jump to, type / to search" data-analytics-event="{&quot;action&quot;:&quot;searchbar&quot;,&quot;tag&quot;:&quot;input&quot;,&quot;context&quot;:&quot;global&quot;,&quot;location&quot;:&quot;navbar&quot;,&quot;label&quot;:&quot;searchbar_input_global_navbar&quot;}"><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-subtle___8ndWH"><span class="HeaderSearch-module__content__kMpxU"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search HeaderSearch-module__icon__wcrHX" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg><span class="HeaderSearch-module__label__d1iWG">Search</span><kbd class="HeaderSearch-module__kbd__HNG0o" aria-hidden="true">/</kbd></span></span></span></button><div class="d-none"></div></div><div class="AuthCTAs-module__signInWrap__q2P60"><a class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--subtle___F7pEE Primer_Brand__Button-module__Button--size-small___zQrEw AuthCTAs-module__cta__WpwQq AuthCTAs-module__desktopActionGap__UZuXT AuthCTAs-module__hiddenBelowLg__BfKBw" href="/login?return_to=https%3A%2F%2Fgithub.com%2FAI-Hypercomputer%2Fmaxdiffusion%2Fblob%2Fmain%2FREADME.md" data-analytics-event="{&quot;action&quot;:&quot;sign_in&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;auth_cta&quot;,&quot;location&quot;:&quot;header&quot;,&quot;label&quot;:&quot;sign_in_link_auth_cta_header&quot;}" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9d1641343cb8d9c388e6fd3924252739cce41494cbf638d835d0bc56aec828ff"><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-subtle___8ndWH">Sign in</span></span></a></div><a class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--secondary___gHnw_ Primer_Brand__Button-module__Button--size-small___zQrEw AuthCTAs-module__cta__WpwQq" href="/signup?ref_cta=Sign+up&amp;ref_loc=header+logged+out&amp;ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow&amp;source=header-repo&amp;source_repo=AI-Hypercomputer%2Fmaxdiffusion" data-analytics-event="{&quot;action&quot;:&quot;sign_up&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;context&quot;:&quot;auth_cta&quot;,&quot;location&quot;:&quot;header&quot;,&quot;label&quot;:&quot;sign_up_link_auth_cta_header&quot;}" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9d1641343cb8d9c388e6fd3924252739cce41494cbf638d835d0bc56aec828ff"><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-secondary___eJ0_a">Sign up</span></span></a><button class="Primer_Brand__Button-module__Button___scH9Z Primer_Brand__Button-module__Button--subtle___F7pEE Primer_Brand__Button-module__Button--size-small___zQrEw HeaderAppearanceSettings-module__trigger__hUheK" type="button" aria-haspopup="dialog" aria-labelledby="_R_fbd_"><span class="Primer_Brand__Button-module__Button__leading-visual___jjtTe" data-testid="Button-leading-visual"><svg data-component="Octicon" focusable="false" aria-hidden="true" class="octicon octicon-sliders Primer_Brand__Button-module__Button__icon-visual____qybb" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M15 2.75a.75.75 0 0 1-.75.75h-4a.75.75 0 0 1 0-1.5h4a.75.75 0 0 1 .75.75Zm-8.5.75v1.25a.75.75 0 0 0 1.5 0v-4a.75.75 0 0 0-1.5 0V2H1.75a.75.75 0 0 0 0 1.5H6.5Zm1.25 5.25a.75.75 0 0 0 0-1.5h-6a.75.75 0 0 0 0 1.5h6ZM15 8a.75.75 0 0 1-.75.75H11.5V10a.75.75 0 1 1-1.5 0V6a.75.75 0 0 1 1.5 0v1.25h2.75A.75.75 0 0 1 15 8Zm-9 5.25v-2a.75.75 0 0 0-1.5 0v1.25H1.75a.75.75 0 0 0 0 1.5H4.5v1.25a.75.75 0 0 0 1.5 0v-2Zm9 0a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h6a.75.75 0 0 1 .75.75Z"></path></svg></span><span class="Primer_Brand__Button-module__Button__text___ED0bX"><span class="Primer_Brand__Text-module__Text___XeGJJ Primer_Brand__Text-module__Text-font--mona-sans___a8XJD Primer_Brand__Text-module__Text--default___GhPh_ Primer_Brand__Text-module__Text--100___B2ueX Primer_Brand__Text-module__Text--weight-medium___qJKf_ Primer_Brand__Button-module__Button--label___qrkyz Primer_Brand__Button-module__Button--label-subtle___8ndWH"></span></span></button><div class="Primer_Brand__Tooltip-module__Tooltip___0Eipx" data-direction="s" aria-hidden="true" id="_R_fbd_">Appearance settings</div></div></div></div></div><div class="MarketingHeader-module__bottomBorder__uZT38" aria-hidden="true"></div></header></div></div>
</react-partial>



      <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full">
  
        <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>
        <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>
        <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>

    <button id="icon-button-4c5ec615-8c24-482a-ae69-9d12635f2915" aria-labelledby="tooltip-8325dfed-4642-4ad0-aaca-5f344b261723" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close">  <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
</button><tool-tip id="tooltip-8325dfed-4642-4ad0-aaca-5f344b261723" for="icon-button-4c5ec615-8c24-482a-ae69-9d12635f2915" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip>


  
</div>
    </div>

  <div id="start-of-content" class="show-on-focus"></div>








    <div id="js-flash-container" class="flash-container" data-turbo-replace>





  <template class="js-flash-template">
    
<div class="flash flash-full   {{ className }}">
  <div >
    <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message">
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
    </button>
    <div aria-atomic="true" role="alert" class="js-flash-alert">
      
      <div>{{ message }}</div>

    </div>
  </div>
</div>
  </template>
</div>


    






  <div
    class="application-main "
    data-commit-hovercards-enabled
    data-discussion-hovercards-enabled
    data-issue-and-pr-hovercards-enabled
    data-project-hovercards-enabled
  >
        <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class="">
    <main id="js-repo-pjax-container" >
      
      
    

      <include-fragment src="/in-product-messaging/budget-threshold-banner?organization=AI-Hypercomputer" data-nonce="v2:e40163cf-fe48-415a-3bf7-a6d8a2023c9c" data-view-component="true">
  
  <div data-show-on-forbidden-error hidden>
    <div class="Box">
  <div class="blankslate-container">
    <div data-view-component="true" class="blankslate blankslate-spacious color-bg-default rounded-2">
      

      <h3 data-view-component="true" class="blankslate-heading">        Uh oh!
</h3>
      <p data-view-component="true" class="blankslate-description">        <p class="color-fg-muted my-2 mb-2 ws-normal">There was an error while loading. <a class="Link--inTextBlock" data-turbo="false" href="" aria-label="Please reload this page">Please reload this page</a>.</p>
</p>

</div>  </div>
</div>  </div>
</include-fragment>

    








  

    <div id="repository-container-header"  class="tmp-pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace>

        <div class="d-flex flex-nowrap flex-justify-end tmp-mb-3  tmp-px-3 tmp-px-lg-5" style="gap: 1rem;">

          <div class="flex-auto min-width-0 width-fit">
              
  <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal">
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2 tmp-mr-2">
    <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path>
</svg>
    
    <span class="author flex-self-stretch" itemprop="author">
      <a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/AI-Hypercomputer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/AI-Hypercomputer">
        AI-Hypercomputer
</a>    </span>
    <span class="mx-1 flex-self-stretch color-fg-muted">/</span>
    <strong itemprop="name" class="mr-2 flex-self-stretch">
      <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/AI-Hypercomputer/maxdiffusion">maxdiffusion</a>
    </strong>

    <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span>
  </div>


          </div>

          <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;">
              <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;">
    
      

  <li>
            <a href="/login?return_to=%2FAI-Hypercomputer%2Fmaxdiffusion" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="8a297527f79c293dcf7c8f1dd004fbb82fcbfe4c7f000e1d93c22b010180e0f9" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn">    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2 tmp-mr-2">
    <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path>
</svg>Notifications
</a>    <tool-tip id="tooltip-12601503-d4c6-4909-b548-d8208ba1c9c1" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip>

  </li>

  <li>
          <a icon="repo-forked" id="fork-button" href="/login?return_to=%2FAI-Hypercomputer%2Fmaxdiffusion" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;repo details fork button&quot;,&quot;repository_id&quot;:693349437,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="33b8bcbe55d88211221ab06cd3f5f4d83676ba759f89c3f96fb9e47e7a041522" data-view-component="true" class="btn-sm btn">    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2 tmp-mr-2">
    <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path>
</svg>Fork
    <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="94" data-view-component="true" class="Counter">94</span>
</a>
  </li>

  <li>
        <div data-view-component="true" class="BtnGroup d-flex">
        <a href="/login?return_to=%2FAI-Hypercomputer%2Fmaxdiffusion" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:693349437,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="be25b73832992809de5784f3d2511693f0b31882c303bd33d93e3fdda5845844" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn">    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2 tmp-mr-2">
    <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path>
</svg><span data-view-component="true" class="d-inline">
          Star
</span>          <span id="repo-stars-counter-star" aria-label="386 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="386" data-view-component="true" class="Counter js-social-count">386</span>
</a></div>
  </li>

</ul>

          </div>
        </div>

          <div id="responsive-meta-container" data-turbo-replace>
</div>


            <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 tmp-px-3 px-md-4 tmp-px-md-4 px-lg-5 tmp-px-lg-5">

  <ul data-view-component="true" class="UnderlineNav-body list-style-none">
      <li data-view-component="true" class="d-inline-flex">
  <a id="code-tab" href="/AI-Hypercomputer/maxdiffusion" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /AI-Hypercomputer/maxdiffusion" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-command-id="repositories:go-to-code" data-react-nav="code-view" data-react-nav-anchor="code-view-repo-link" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Code&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline">
    <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path>
</svg>
        <span data-content="Code">Code</span>
          <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="issues-tab" href="/AI-Hypercomputer/maxdiffusion/issues" data-tab-item="i1issues-tab" data-selected-links="repo_issues repo_labels repo_milestones /AI-Hypercomputer/maxdiffusion/issues" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g i" data-command-id="repositories:go-to-issues" data-react-nav="issues-react" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Issues&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline">
    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path>
</svg>
        <span data-content="Issues">Issues</span>
          <span id="issues-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="11" data-view-component="true" class="Counter">11</span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="pull-requests-tab" href="/AI-Hypercomputer/maxdiffusion/pulls" data-tab-item="i2pull-requests-tab" data-selected-links="repo_pulls checks /AI-Hypercomputer/maxdiffusion/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-command-id="repositories:go-to-pull-requests" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Pull requests&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline">
    <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path>
</svg>
        <span data-content="Pull requests">Pull requests</span>
          <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="15" data-view-component="true" class="Counter">15</span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="actions-tab" href="/AI-Hypercomputer/maxdiffusion/actions" data-tab-item="i3actions-tab" data-selected-links="repo_actions /AI-Hypercomputer/maxdiffusion/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-command-id="repositories:go-to-actions" data-react-nav="actions-workflows" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Actions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline">
    <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path>
</svg>
        <span data-content="Actions">Actions</span>
          <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="projects-tab" href="/AI-Hypercomputer/maxdiffusion/projects" data-tab-item="i4projects-tab" data-selected-links="repo_projects new_repo_project repo_project /AI-Hypercomputer/maxdiffusion/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-command-id="repositories:go-to-projects" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Projects&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline">
    <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path>
</svg>
        <span data-content="Projects">Projects</span>
          <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="security-and-quality-tab" href="/AI-Hypercomputer/maxdiffusion/security" data-tab-item="i5security-and-quality-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /AI-Hypercomputer/maxdiffusion/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-command-id="repositories:go-to-security" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Security and quality&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline">
    <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        <span data-content="Security and quality">Security and quality</span>
          <span id="security-and-quality-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="0" hidden="hidden" data-view-component="true" class="Counter">0</span>


    
</a></li>
      <li data-view-component="true" class="d-inline-flex">
  <a id="insights-tab" href="/AI-Hypercomputer/maxdiffusion/pulse" data-tab-item="i6insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /AI-Hypercomputer/maxdiffusion/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-command-id="repositories:go-to-insights" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Insights&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item">
    
              <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline">
    <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path>
</svg>
        <span data-content="Insights">Insights</span>
          <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span>


    
</a></li>
</ul>
    <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 tmp-pr-3 pr-md-4 tmp-pr-md-4 pr-lg-5 tmp-pr-lg-5 right-0">      <action-menu data-select-variant="none" data-view-component="true">
  <focus-group direction="vertical" mnemonics retain>
    <button id="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-button" popovertarget="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-overlay" aria-controls="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-list" aria-haspopup="true" aria-labelledby="tooltip-18ab17bc-f6e4-487f-9bbb-5c45935490db" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item">  <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual">
    <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path>
</svg>
</button><tool-tip id="tooltip-18ab17bc-f6e4-487f-9bbb-5c45935490db" for="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip>


<anchored-position data-target="action-menu.overlay" id="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-overlay" anchor="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true">
  <div data-view-component="true" class="Overlay Overlay--size-auto">
    
      <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone">          <action-list>
  <div data-view-component="true">
    <ul aria-labelledby="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-button" id="action-menu-b95287e6-8583-44aa-99ca-01ff77bf6ff7-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap">
        <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-d3a24530-3412-43f8-83df-3653c1c6fd9a" href="/AI-Hypercomputer/maxdiffusion" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code">
    <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Code
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i1issues-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-f89b53ab-44b8-4988-bcd6-ca41697eafa2" href="/AI-Hypercomputer/maxdiffusion/issues" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened">
    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Issues
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i2pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-02c50a02-19e0-44bc-9a06-079c3ae88c82" href="/AI-Hypercomputer/maxdiffusion/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request">
    <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Pull requests
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i3actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-807e14e3-e04b-4cf9-a1d7-d05becb2111e" href="/AI-Hypercomputer/maxdiffusion/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play">
    <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Actions
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i4projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-9325db1a-82aa-4e38-abaa-b8058e67ee0a" href="/AI-Hypercomputer/maxdiffusion/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table">
    <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Projects
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i5security-and-quality-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-6d78ab89-b5a8-48eb-a37b-b3d01eb66479" href="/AI-Hypercomputer/maxdiffusion/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield">
    <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Security and quality
</span>      
</a>
  
</li>
        <li hidden="hidden" data-menu-item="i6insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">
    
    
    <a tabindex="-1" id="item-bc704187-5d69-4a35-bdba-0876d16d927c" href="/AI-Hypercomputer/maxdiffusion/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph">
    <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path>
</svg>
        </span>
      
        <span data-view-component="true" class="ActionListItem-label">
          Insights
</span>      
</a>
  
</li>
</ul>    
</div></action-list>


</div>
      
</div></anchored-position>  </focus-group>
</action-menu></div>
</nav>

    </div>
  



<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class="">
    <div id="repo-content-pjax-container" class="repository-content " >
    



    
      
    








<react-app
  app-name="code-view"
  initial-path="/AI-Hypercomputer/maxdiffusion/blob/main/README.md"
  style="display: block; min-height: calc(100vh - 64px);"
  data-attempted-ssr="true"
  data-ssr="true"
  data-lazy="false"
  data-alternate="false"
  data-data-router-enabled="true"
  data-react-profiling="false"
>
  
  <script type="application/json" data-target="react-app.embeddedData">{"payload":{"codeViewBlobRoute":{"csv":null,"csvError":null,"headerInfo":{"toc":[{"level":1,"text":"What's new?","anchor":"whats-new","htmlText":"What's new?"},{"level":1,"text":"Overview","anchor":"overview","htmlText":"Overview"},{"level":1,"text":"Table of Contents","anchor":"table-of-contents","htmlText":"Table of Contents"},{"level":1,"text":"Getting Started","anchor":"getting-started","htmlText":"Getting Started"},{"level":2,"text":"Getting Started:","anchor":"getting-started-1","htmlText":"Getting Started:"},{"level":2,"text":"NVIDIA DGX Spark","anchor":"nvidia-dgx-spark","htmlText":"NVIDIA DGX Spark"},{"level":2,"text":"Training","anchor":"training","htmlText":"Training"},{"level":2,"text":"Wan 2.1 Training","anchor":"wan-21-training","htmlText":"Wan 2.1 Training"},{"level":3,"text":"Dataset Preparation","anchor":"dataset-preparation","htmlText":"Dataset Preparation"},{"level":3,"text":"Training on a Single VM","anchor":"training-on-a-single-vm","htmlText":"Training on a Single VM"},{"level":3,"text":"Deploying with XPK","anchor":"deploying-with-xpk","htmlText":"Deploying with XPK"},{"level":2,"text":"Flux Training","anchor":"flux-training","htmlText":"Flux Training"},{"level":2,"text":"Stable Diffusion XL Training","anchor":"stable-diffusion-xl-training","htmlText":"Stable Diffusion XL Training"},{"level":2,"text":"Stable Diffusion 2 base Training","anchor":"stable-diffusion-2-base-training","htmlText":"Stable Diffusion 2 base Training"},{"level":2,"text":"Stable Diffusion 1.4 Training","anchor":"stable-diffusion-14-training","htmlText":"Stable Diffusion 1.4 Training"},{"level":2,"text":"Dreambooth","anchor":"dreambooth","htmlText":"Dreambooth"},{"level":2,"text":"Inference","anchor":"inference","htmlText":"Inference"},{"level":2,"text":"Stable Diffusion XL","anchor":"stable-diffusion-xl","htmlText":"Stable Diffusion XL"},{"level":2,"text":"Stable Diffusion 2 base","anchor":"stable-diffusion-2-base","htmlText":"Stable Diffusion 2 base"},{"level":2,"text":"Stable Diffusion 2.1","anchor":"stable-diffusion-21","htmlText":"Stable Diffusion 2.1"},{"level":2,"text":"LTX-Video","anchor":"ltx-video","htmlText":"LTX-Video"},{"level":2,"text":"LTX-2 Video","anchor":"ltx-2-video","htmlText":"LTX-2 Video"},{"level":2,"text":"Wan Models","anchor":"wan-models","htmlText":"Wan Models"},{"level":3,"text":"Ulysses Attention","anchor":"ulysses-attention","htmlText":"Ulysses Attention"},{"level":4,"text":"Chunked Ulysses Attention (Overlapping Communication and Compute)","anchor":"chunked-ulysses-attention-overlapping-communication-and-compute","htmlText":"Chunked Ulysses Attention (Overlapping Communication and Compute)"},{"level":3,"text":"Caching Mechanisms","anchor":"caching-mechanisms","htmlText":"Caching Mechanisms"},{"level":3,"text":"Ring Attention","anchor":"ring-attention","htmlText":"Ring Attention"},{"level":3,"text":"Automatic Tile-Size Search","anchor":"automatic-tile-size-search","htmlText":"Automatic Tile-Size Search"},{"level":2,"text":"Flux","anchor":"flux","htmlText":"Flux"},{"level":3,"text":"Flux.2-Klein (4B \u0026 9B)","anchor":"flux2-klein-4b--9b","htmlText":"Flux.2-Klein (4B \u0026amp; 9B)"},{"level":4,"text":"Text-to-Image Generation:","anchor":"text-to-image-generation","htmlText":"Text-to-Image Generation:"},{"level":4,"text":"Multi-Reference Image Editing:","anchor":"multi-reference-image-editing","htmlText":"Multi-Reference Image Editing:"},{"level":2,"text":"Fused Attention for GPU:","anchor":"fused-attention-for-gpu","htmlText":"Fused Attention for GPU:"},{"level":2,"text":"Wan LoRA","anchor":"wan-lora","htmlText":"Wan LoRA"},{"level":2,"text":"Flux LoRA","anchor":"flux-lora","htmlText":"Flux LoRA"},{"level":2,"text":"Hyper SDXL LoRA","anchor":"hyper-sdxl-lora","htmlText":"Hyper SDXL LoRA"},{"level":2,"text":"Load Multiple LoRA","anchor":"load-multiple-lora","htmlText":"Load Multiple LoRA"},{"level":2,"text":"SDXL Lightning","anchor":"sdxl-lightning","htmlText":"SDXL Lightning"},{"level":2,"text":"ControlNet","anchor":"controlnet","htmlText":"ControlNet"},{"level":3,"text":"Stable Diffusion 1.4","anchor":"stable-diffusion-14","htmlText":"Stable Diffusion 1.4"},{"level":3,"text":"Stable Diffusion XL","anchor":"stable-diffusion-xl-1","htmlText":"Stable Diffusion XL"},{"level":2,"text":"Getting Started: Multihost development","anchor":"getting-started-multihost-development","htmlText":"Getting Started: Multihost development"},{"level":1,"text":"Comparison to Alternatives","anchor":"comparison-to-alternatives","htmlText":"Comparison to Alternatives"},{"level":1,"text":"Development","anchor":"development","htmlText":"Development"},{"level":3,"text":"Pre-commit Hooks","anchor":"pre-commit-hooks","htmlText":"Pre-commit Hooks"},{"level":3,"text":"Code Style","anchor":"code-style","htmlText":"Code Style"},{"level":2,"text":"Profiling","anchor":"profiling","htmlText":"Profiling"},{"level":2,"text":"Metrics","anchor":"metrics","htmlText":"Metrics"}]},"issueTemplate":null,"discussionTemplate":null,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml\"\u003e\u003cimg src=\"https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml/badge.svg\" alt=\"Unit Tests\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWhat's new?\u003c/h1\u003e\u003ca id=\"user-content-whats-new\" class=\"anchor\" aria-label=\"Permalink: What's new?\" href=\"#whats-new\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/08/28\u003c/code\u003e\u003c/strong\u003e: Flux2.Klein text to image and image editing (w/ KV Cache) is now supported.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/07/14\u003c/code\u003e\u003c/strong\u003e: Automatic attention tile-size (\u003ccode\u003eblock_q\u003c/code\u003e/\u003ccode\u003eblock_kv\u003c/code\u003e) search for Wan is now supported.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/06/26\u003c/code\u003e\u003c/strong\u003e: 2D ring (USP) attention with a custom splash kernel is now supported for Wan (\u003ccode\u003eulysses_ring_custom\u003c/code\u003e), splitting context parallelism into an intra-chip Ulysses axis and a cross-chip ring axis.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/04/16\u003c/code\u003e\u003c/strong\u003e: Support for Tokamax Ring Attention kernel is now added.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/03/31\u003c/code\u003e\u003c/strong\u003e: Wan2.2 SenCache inference is now supported for T2V and I2V (up to 1.4x speedup)\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/03/25\u003c/code\u003e\u003c/strong\u003e: Wan2.1 and Wan2.2 Magcache inference is now supported\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/03/25\u003c/code\u003e\u003c/strong\u003e: LTX-2 Video Inference is now supported\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/01/29\u003c/code\u003e\u003c/strong\u003e: Wan LoRA for inference is now supported\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2026/01/15\u003c/code\u003e\u003c/strong\u003e: Wan2.1 and Wan2.2 Img2vid generation is now supported\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/11/11\u003c/code\u003e\u003c/strong\u003e: Wan2.2 txt2vid generation is now supported\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/10/10\u003c/code\u003e\u003c/strong\u003e: Wan2.1 txt2vid training and generation is now supported.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/10/14\u003c/code\u003e\u003c/strong\u003e: NVIDIA DGX Spark Flux support.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/08/14\u003c/code\u003e\u003c/strong\u003e: LTX-Video img2vid generation is now supported.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/07/29\u003c/code\u003e\u003c/strong\u003e: LTX-Video text2vid generation is now supported.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/04/17\u003c/code\u003e\u003c/strong\u003e: Flux Finetuning.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/02/12\u003c/code\u003e\u003c/strong\u003e: Flux LoRA for inference.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2025/02/08\u003c/code\u003e\u003c/strong\u003e: Flux schnell \u0026amp; dev inference.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2024/12/12\u003c/code\u003e\u003c/strong\u003e: Load multiple LoRAs for inference.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2024/10/22\u003c/code\u003e\u003c/strong\u003e: LoRA support for Hyper SDXL.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2024/08/01\u003c/code\u003e\u003c/strong\u003e: Orbax is the new default checkpointer. You can still use \u003ccode\u003epipeline.save_pretrained\u003c/code\u003e after training to save in diffusers format.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003e2024/07/20\u003c/code\u003e\u003c/strong\u003e: Dreambooth training for Stable Diffusion 1.x,2.x is now supported.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOverview\u003c/h1\u003e\u003ca id=\"user-content-overview\" class=\"anchor\" aria-label=\"Permalink: Overview\" href=\"#overview\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMaxDiffusion is a collection of reference implementations of various latent diffusion models written in pure Python/Jax that run on XLA devices including Cloud TPUs and GPUs. MaxDiffusion aims to be a launching off point for ambitious Diffusion projects both in research and production. We encourage you to start by experimenting with MaxDiffusion out of the box and then fork and modify MaxDiffusion to meet your needs.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe goal of this project is to provide reference implementations for latent diffusion models that help developers get started with training, tuning, and serving solutions on XLA devices including Cloud TPUs and GPUs. We started with Stable Diffusion inference on TPUs, but welcome code contributions to grow.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMaxDiffusion supports\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eStable Diffusion 2 base (inference)\u003c/li\u003e\n\u003cli\u003eStable Diffusion 2.1 (training and inference)\u003c/li\u003e\n\u003cli\u003eStable Diffusion XL (training and inference).\u003c/li\u003e\n\u003cli\u003eFlux Dev and Schnell (Training and inference).\u003c/li\u003e\n\u003cli\u003eFlux.2-Klein 4B \u0026amp; 9B (text-to-image and multi-image editing with KV-Cache).\u003c/li\u003e\n\u003cli\u003eStable Diffusion Lightning (inference).\u003c/li\u003e\n\u003cli\u003eHyper-SD XL LoRA loading (inference).\u003c/li\u003e\n\u003cli\u003eLoad Multiple LoRA (SDXL inference).\u003c/li\u003e\n\u003cli\u003eControlNet inference (Stable Diffusion 1.4 \u0026amp; SDXL).\u003c/li\u003e\n\u003cli\u003eDreambooth training support for Stable Diffusion 1.x,2.x.\u003c/li\u003e\n\u003cli\u003eLTX-Video text2vid, img2vid (inference).\u003c/li\u003e\n\u003cli\u003eLTX-2 Video text2vid (inference).\u003c/li\u003e\n\u003cli\u003eWan2.1 text2vid (training and inference).\u003c/li\u003e\n\u003cli\u003eWan2.2 text2vid (inference).\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eNote on GPU Support:\u003c/strong\u003e GPU support is not actively maintained, but contributions are welcome\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTable of Contents\u003c/h1\u003e\u003ca id=\"user-content-table-of-contents\" class=\"anchor\" aria-label=\"Permalink: Table of Contents\" href=\"#table-of-contents\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#whats-new\"\u003eWhat's new?\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#table-of-contents\"\u003eTable of Contents\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#getting-started-1\"\u003eGetting Started:\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#nvidia-dgx-spark\"\u003eNVIDIA DGX Spark\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#training\"\u003eTraining\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#wan-21-training\"\u003eWan2.1\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#flux-training\"\u003eFlux\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-xl-training\"\u003eSDXL\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-2-base-training\"\u003eSD 2 base\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-14-training\"\u003eSD 1.4\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#dreambooth\"\u003eDreambooth\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#inference\"\u003eInference\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#wan-models\"\u003eWan\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#ltx-video\"\u003eLTX-Video\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#ltx-2-video\"\u003eLTX-2 Video\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#flux\"\u003eFlux\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#fused-attention-for-gpu\"\u003eFused Attention for GPU\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-xl\"\u003eSDXL\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-2-base\"\u003eSD 2 base\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stable-diffusion-21\"\u003eSD 2.1\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#wan-lora\"\u003eWan LoRA\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#flux-lora\"\u003eFlux LoRA\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#hyper-sdxl-lora\"\u003eHyper SDXL LoRA\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#load-multiple-lora\"\u003eLoad Multiple LoRA\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#sdxl-lightning\"\u003eSDXL Lightning\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#controlnet\"\u003eControlNet\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#getting-started-multihost-development\"\u003eGetting Started: Multihost development\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#comparison-to-alternatives\"\u003eComparison to Alternatives\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#development\"\u003eDevelopment\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#profiling\"\u003eProfiling\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#metrics\"\u003eMetrics\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGetting Started\u003c/h1\u003e\u003ca id=\"user-content-getting-started\" class=\"anchor\" aria-label=\"Permalink: Getting Started\" href=\"#getting-started\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe recommend starting with a single TPU host and then moving to multihost.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMinimum requirements: Ubuntu Version 22.04, Python 3.12 and Tensorflow \u0026gt;= 2.12.0.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGetting Started:\u003c/h2\u003e\u003ca id=\"user-content-getting-started-1\" class=\"anchor\" aria-label=\"Permalink: Getting Started:\" href=\"#getting-started-1\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFor your first time running Maxdiffusion, we provide specific \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/docs/getting_started/first_run.md\"\u003einstructions\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eNVIDIA DGX Spark\u003c/h2\u003e\u003ca id=\"user-content-nvidia-dgx-spark\" class=\"anchor\" aria-label=\"Permalink: NVIDIA DGX Spark\" href=\"#nvidia-dgx-spark\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTry out MaxDiffusion on NVIDIA's DGX Spark. We provide specific \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/docs/dgx_spark.md\"\u003einstructions\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTraining\u003c/h2\u003e\u003ca id=\"user-content-training\" class=\"anchor\" aria-label=\"Permalink: Training\" href=\"#training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAfter installation completes, run the training script.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWan 2.1 Training\u003c/h2\u003e\u003ca id=\"user-content-wan-21-training\" class=\"anchor\" aria-label=\"Permalink: Wan 2.1 Training\" href=\"#wan-21-training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ein the first part, we'll run on a single host VM to get familiar with the workflow, then run on xpk for large scale training.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAlthough not required, attaching an external disk is recommended as weights take up a lot of disk space. \u003ca href=\"https://cloud.google.com/tpu/docs/attach-durable-block-storage\" rel=\"nofollow\"\u003eFollow these instructions if you would like to attach an external disk\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis workflow was tested using v5p-8 with a 500GB disk attached.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDataset Preparation\u003c/h3\u003e\u003ca id=\"user-content-dataset-preparation\" class=\"anchor\" aria-label=\"Permalink: Dataset Preparation\" href=\"#dataset-preparation\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFor this example, we'll be using the \u003ca href=\"https://huggingface.co/datasets/RaphaelLiu/PusaV1_training\" rel=\"nofollow\"\u003ePusaV1 dataset\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFirst, download the dataset.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export HF_DATASET_DIR=/mnt/disks/external_disk/PusaV1_training/\nexport TFRECORDS_DATASET_DIR=/mnt/disks/external_disk/wan_tfr_dataset_pusa_v1\nhuggingface-cli download RaphaelLiu/PusaV1_training --repo-type dataset --local-dir $HF_DATASET_DIR\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e HF_DATASET_DIR=/mnt/disks/external_disk/PusaV1_training/\n\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e TFRECORDS_DATASET_DIR=/mnt/disks/external_disk/wan_tfr_dataset_pusa_v1\nhuggingface-cli download RaphaelLiu/PusaV1_training --repo-type dataset --local-dir \u003cspan class=\"pl-smi\"\u003e$HF_DATASET_DIR\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNext run the TFRecords conversion script. This step prepares training and eval datasets. Validation is done as described in  \u003ca href=\"https://arxiv.org/pdf/2403.03206\" rel=\"nofollow\"\u003eScaling Rectified Flow Transformers for High-Resolution Image Synthesis\u003c/a\u003e. More details \u003ca href=\"https://github.com/mlcommons/training/tree/master/text_to_image#5-quality\"\u003ehere\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTraining dataset.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/train no_records_per_shard=10 enable_eval_timesteps=False\"\u003e\u003cpre\u003epython src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=\u003cspan class=\"pl-smi\"\u003e$HF_DATASET_DIR\u003c/span\u003e tfrecords_dir=\u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/train no_records_per_shard=10 enable_eval_timesteps=False\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe script will not have an output, but you can check the progress using:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"ls -ll $TFRECORDS_DATASET_DIR/train\"\u003e\u003cpre\u003els -ll \u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/train\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eEvaluation dataset.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/eval no_records_per_shard=10 enable_eval_timesteps=True\"\u003e\u003cpre\u003epython src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=\u003cspan class=\"pl-smi\"\u003e$HF_DATASET_DIR\u003c/span\u003e tfrecords_dir=\u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/eval no_records_per_shard=10 enable_eval_timesteps=True\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe evaluation dataset creation takes the first 420 samples of the dataset and adds a timestep field. We then need to manually delete the first 420 samples from the \u003ccode\u003etrain\u003c/code\u003e folder so they are not used in training.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"printf \u0026quot;%s\\n\u0026quot; $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 \u0026lt;= 420' | xargs -d '\\n' rm\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eprintf\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e%s\\n\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/train/file_\u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e-\u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e.tfrec \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e awk -F \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e[-.]\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e$2+0 \u0026lt;= 420\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e xargs -d \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\\n\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e rm\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAnd verify that they do not exist.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"printf \u0026quot;%s\\n\u0026quot; $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 \u0026lt;= 420' | xargs -d '\\n' echo\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eprintf\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e%s\\n\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/train/file_\u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e-\u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e.tfrec \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e awk -F \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e[-.]\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e$2+0 \u0026lt;= 420\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e xargs -d \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\\n\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eecho\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAfter the script is done running, you should see the following directory structure inside \u003ccode\u003e$TFRECORDS_DATASET_DIR\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"train\neval_timesteps\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003etrain\neval_timesteps\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn some instances an empty file \u003ccode\u003efile_42-430.tfrec\u003c/code\u003e is created inside \u003ccode\u003eeval_timesteps\u003c/code\u003e, for sanity check, let's run a delete command.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"rm $TFRECORDS_DATASET_DIR/eval_timesteps/file_42-430.tfrec\"\u003e\u003cpre\u003erm \u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e/eval_timesteps/file_42-430.tfrec\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTraining on a Single VM\u003c/h3\u003e\u003ca id=\"user-content-training-on-a-single-vm\" class=\"anchor\" aria-label=\"Permalink: Training on a Single VM\" href=\"#training-on-a-single-vm\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLoading the data is supported both locally from the disk created above, or from \u003ccode\u003egcs\u003c/code\u003e. In this guide, we'll be using a gcs bucket to train. First copy the data to the GCS bucket.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"BUCKET_NAME=my-bucket\ngcloud storage cp --recursive $TFRECORDS_DATASET_DIR gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}\"\u003e\u003cpre\u003eBUCKET_NAME=my-bucket\ngcloud storage cp --recursive \u003cspan class=\"pl-smi\"\u003e$TFRECORDS_DATASET_DIR\u003c/span\u003e gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNow run the training command:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}\nOUTPUT_DIR=gs://$BUCKET_NAME/wan/\nDATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/\nEVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/\nSAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/\"\u003e\u003cpre\u003eRUN_NAME=jfacevedo-wan-v5p-8-\u003cspan class=\"pl-smi\"\u003e${RANDOM}\u003c/span\u003e\nOUTPUT_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/wan/\nDATASET_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/train/\nEVAL_DATA_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/eval_timesteps/\nSAVE_DATASET_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/save/\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\\n--xla_tpu_megacore_fusion_allow_ags=false \\\n--xla_enable_async_collective_permute=true \\\n--xla_tpu_enable_ag_backward_pipelining=true \\\n--xla_tpu_enable_data_parallel_all_reduce_opt=true \\\n--xla_tpu_data_parallel_opt_different_sized_ops=true \\\n--xla_tpu_enable_async_collective_fusion=true \\\n--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\n--xla_tpu_overlap_compute_collective_tc=true \\\n--xla_enable_async_all_gather=true \\\n--xla_tpu_scoped_vmem_limit_kib=65536 \\\n--xla_tpu_enable_async_all_to_all=true \\\n--xla_tpu_enable_all_experimental_scheduler_features=true \\\n--xla_tpu_enable_scheduler_memory_pressure_tracking=true \\\n--xla_tpu_host_transfer_overlap_limit=24 \\\n--xla_tpu_aggressive_opt_barrier_removal=ENABLED \\\n--xla_lhs_prioritize_async_depth_over_stall=ENABLED \\\n--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\\n--xla_should_add_loop_invariant_op_in_chain=ENABLED \\\n--xla_max_concurrent_host_send_recv=100 \\\n--xla_tpu_scheduler_percent_shared_memory_limit=100 \\\n--xla_latency_hiding_scheduler_rerun=2 \\\n--xla_tpu_use_minor_sharding_for_major_trivial_input=true \\\n--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\\n--xla_tpu_assign_all_reduce_scatter_layout=true'\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e LIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_megacore_fusion_allow_ags=false \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_collective_permute=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_ag_backward_pipelining=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_data_parallel_all_reduce_opt=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_data_parallel_opt_different_sized_ops=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_overlap_compute_collective_tc=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_all_gather=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_scoped_vmem_limit_kib=65536 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_all_to_all=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_all_experimental_scheduler_features=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_scheduler_memory_pressure_tracking=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_host_transfer_overlap_limit=24 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_aggressive_opt_barrier_removal=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_lhs_prioritize_async_depth_over_stall=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_should_add_loop_invariant_op_in_chain=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_max_concurrent_host_send_recv=100 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_scheduler_percent_shared_memory_limit=100 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_latency_hiding_scheduler_rerun=2 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_use_minor_sharding_for_major_trivial_input=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_assign_all_reduce_scatter_layout=true\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \\\nsrc/maxdiffusion/configs/base_wan_14b.yml \\\nattention='flash' \\\nweights_dtype=bfloat16 \\\nactivations_dtype=bfloat16 \\\nguidance_scale=5.0 \\\nflow_shift=5.0 \\\nfps=16 \\\nskip_jax_distributed_system=False \\\nrun_name=${RUN_NAME} \\\noutput_dir=${OUTPUT_DIR} \\\ntrain_data_dir=${DATASET_DIR} \\\nload_tfrecord_cached=True \\\nheight=1280 \\\nwidth=720 \\\nnum_frames=81 \\\nnum_inference_steps=50 \\\njax_cache_dir=${OUTPUT_DIR}/jax_cache/ \\\nmax_train_steps=1000 \\\nenable_profiler=True \\\ndataset_save_location=${SAVE_DATASET_DIR} \\\nremat_policy='HIDDEN_STATE_WITH_OFFLOAD' \\\nflash_min_seq_length=0 \\\nseed=$RANDOM \\\nskip_first_n_steps_for_profiler=3 \\\nprofiler_steps=3 \\\nper_device_batch_size=0.25 \\\nici_data_parallelism=1 \\\nici_fsdp_parallelism=4 \\\nici_tensor_parallelism=1\"\u003e\u003cpre\u003eHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \\\nsrc/maxdiffusion/configs/base_wan_14b.yml \\\nattention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eflash\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \\\nweights_dtype=bfloat16 \\\nactivations_dtype=bfloat16 \\\nguidance_scale=5.0 \\\nflow_shift=5.0 \\\nfps=16 \\\nskip_jax_distributed_system=False \\\nrun_name=\u003cspan class=\"pl-smi\"\u003e${RUN_NAME}\u003c/span\u003e \\\noutput_dir=\u003cspan class=\"pl-smi\"\u003e${OUTPUT_DIR}\u003c/span\u003e \\\ntrain_data_dir=\u003cspan class=\"pl-smi\"\u003e${DATASET_DIR}\u003c/span\u003e \\\nload_tfrecord_cached=True \\\nheight=1280 \\\nwidth=720 \\\nnum_frames=81 \\\nnum_inference_steps=50 \\\njax_cache_dir=\u003cspan class=\"pl-smi\"\u003e${OUTPUT_DIR}\u003c/span\u003e/jax_cache/ \\\nmax_train_steps=1000 \\\nenable_profiler=True \\\ndataset_save_location=\u003cspan class=\"pl-smi\"\u003e${SAVE_DATASET_DIR}\u003c/span\u003e \\\nremat_policy=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eHIDDEN_STATE_WITH_OFFLOAD\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \\\nflash_min_seq_length=0 \\\nseed=\u003cspan class=\"pl-smi\"\u003e$RANDOM\u003c/span\u003e \\\nskip_first_n_steps_for_profiler=3 \\\nprofiler_steps=3 \\\nper_device_batch_size=0.25 \\\nici_data_parallelism=1 \\\nici_fsdp_parallelism=4 \\\nici_tensor_parallelism=1\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt is important to note a couple of things:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eper_device_batch_size can be a fractional, but must be a whole number when multiplied by number of devices. In this example, 0.25 * 4 (devices) = effective global batch size = 1.\u003c/li\u003e\n\u003cli\u003eThe step time in v5p-8 with global batch size = 1 is large due to using \u003ccode\u003eFULL\u003c/code\u003e remat. On larger number of chips we can run larger batch sizes greatly increasing MFU, as we will see in the next session of deploying with xpk.\u003c/li\u003e\n\u003cli\u003eTo enable eval during training set \u003ccode\u003eeval_every\u003c/code\u003e to a value \u0026gt; 0.\u003c/li\u003e\n\u003cli\u003eIn Wan2.1, the ici_fsdp_parallelism axis is used for sequence parallelism, the ici_tensor_parallelism axis is used for head parallelism.\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eYou can enable both, keeping in mind that Wan2.1 has 40 heads and 40 must be evenly divisible by ici_tensor_parallelism.\u003c/li\u003e\n\u003cli\u003eFor Sequence parallelism, the code pads the sequence length to evenly divide the sequence. Try out different ici_fsdp_parallelism numbers, but we find 2 and 4 to be the best right now.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eFor use on GPU it is recommended to enable the cudnn_te_flash attention kernel for optimal performance.\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eBest performance is achieved with the use of batch parallelism, which can be enabled by using the ici_fsdp_batch_parallelism axis. Note that this parallelism strategy does not support fractional batch sizes.\u003c/li\u003e\n\u003cli\u003eici_fsdp_batch_parallelism and ici_fsdp_parallelism can be combined to allow for fractional batch sizes. However, padding is not currently supported for the cudnn_te_flash attention kernel and it is therefore required that the sequence length is divisible by the number of devices in the ici_fsdp_parallelism axis.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eFor benchmarking training performance on multiple data dimension input without downloading/re-processing the dataset, the synthetic data iterator is supported.\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eSet dataset_type='synthetic' and synthetic_num_samples=null to enable the synthetic data iterator.\u003c/li\u003e\n\u003cli\u003eThe following overrides on data dimensions are supported:\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003esynthetic_override_height: 720\u003c/li\u003e\n\u003cli\u003esynthetic_override_width: 1280\u003c/li\u003e\n\u003cli\u003esynthetic_override_num_frames: 85\u003c/li\u003e\n\u003cli\u003esynthetic_override_max_sequence_length: 512\u003c/li\u003e\n\u003cli\u003esynthetic_override_text_embed_dim: 4096\u003c/li\u003e\n\u003cli\u003esynthetic_override_num_channels_latents: 16\u003c/li\u003e\n\u003cli\u003esynthetic_override_vae_scale_factor_spatial: 8\u003c/li\u003e\n\u003cli\u003esynthetic_override_vae_scale_factor_temporal: 4\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eYou should eventually see a training run as:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"***** Running training *****\nInstantaneous batch size per device = 0.25\nTotal train batch size (w. parallel \u0026amp; distributed) = 1\nTotal optimization steps = 1000\nCalculated TFLOPs per pass: 4893.2719\nWarning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\ncompleted step: 0, seconds: 142.395, TFLOP/s/device: 34.364, loss: 0.270\nTo see full metrics 'tensorboard --logdir=gs://jfacevedo-maxdiffusion-v5p/wan/jfacevedo-wan-v5p-8-17263/tensorboard/'\ncompleted step: 1, seconds: 137.207, TFLOP/s/device: 35.664, loss: 0.144\ncompleted step: 2, seconds: 36.014, TFLOP/s/device: 135.871, loss: 0.210\ncompleted step: 3, seconds: 36.016, TFLOP/s/device: 135.864, loss: 0.120\ncompleted step: 4, seconds: 36.008, TFLOP/s/device: 135.894, loss: 0.107\ncompleted step: 5, seconds: 36.008, TFLOP/s/device: 135.895, loss: 0.346\ncompleted step: 6, seconds: 36.006, TFLOP/s/device: 135.900, loss: 0.169\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003e*****\u003c/span\u003e Running training \u003cspan class=\"pl-k\"\u003e*****\u003c/span\u003e\nInstantaneous batch size per device = 0.25\nTotal train batch size (w. parallel \u003cspan class=\"pl-k\"\u003e\u0026amp;\u003c/span\u003e distributed) = 1\nTotal optimization steps = 1000\nCalculated TFLOPs per pass: 4893.2719\nWarning, batch dimension should be shardable among the devices \u003cspan class=\"pl-k\"\u003ein\u003c/span\u003e data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices \u003cspan class=\"pl-k\"\u003ein\u003c/span\u003e data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices \u003cspan class=\"pl-k\"\u003ein\u003c/span\u003e data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\nWarning, batch dimension should be shardable among the devices \u003cspan class=\"pl-k\"\u003ein\u003c/span\u003e data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4\ncompleted step: 0, seconds: 142.395, TFLOP/s/device: 34.364, loss: 0.270\nTo see full metrics \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003etensorboard --logdir=gs://jfacevedo-maxdiffusion-v5p/wan/jfacevedo-wan-v5p-8-17263/tensorboard/\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\ncompleted step: 1, seconds: 137.207, TFLOP/s/device: 35.664, loss: 0.144\ncompleted step: 2, seconds: 36.014, TFLOP/s/device: 135.871, loss: 0.210\ncompleted step: 3, seconds: 36.016, TFLOP/s/device: 135.864, loss: 0.120\ncompleted step: 4, seconds: 36.008, TFLOP/s/device: 135.894, loss: 0.107\ncompleted step: 5, seconds: 36.008, TFLOP/s/device: 135.895, loss: 0.346\ncompleted step: 6, seconds: 36.006, TFLOP/s/device: 135.900, loss: 0.169\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDeploying with XPK\u003c/h3\u003e\u003ca id=\"user-content-deploying-with-xpk\" class=\"anchor\" aria-label=\"Permalink: Deploying with XPK\" href=\"#deploying-with-xpk\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis assumes the user has already created an xpk cluster, installed all dependencies and the also created the dataset from the step above. For getting started with MaxDiffusion and xpk see \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/docs/getting_started/run_maxdiffusion_via_xpk.md\"\u003ethis guide\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eUsing v5p-256 Then the command to run on xpk is as follows:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}\nOUTPUT_DIR=gs://$BUCKET_NAME/wan/\nDATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/\nEVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/\nSAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/\"\u003e\u003cpre\u003eRUN_NAME=jfacevedo-wan-v5p-8-\u003cspan class=\"pl-smi\"\u003e${RANDOM}\u003c/span\u003e\nOUTPUT_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/wan/\nDATASET_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/train/\nEVAL_DATA_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/eval_timesteps/\nSAVE_DATASET_DIR=gs://\u003cspan class=\"pl-smi\"\u003e$BUCKET_NAME\u003c/span\u003e/\u003cspan class=\"pl-smi\"\u003e${TFRECORDS_DATASET_DIR\u003cspan class=\"pl-k\"\u003e##*/\u003c/span\u003e}\u003c/span\u003e/save/\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\\n--xla_tpu_megacore_fusion_allow_ags=false \\\n--xla_enable_async_collective_permute=true \\\n--xla_tpu_enable_ag_backward_pipelining=true \\\n--xla_tpu_enable_data_parallel_all_reduce_opt=true \\\n--xla_tpu_data_parallel_opt_different_sized_ops=true \\\n--xla_tpu_enable_async_collective_fusion=true \\\n--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\n--xla_tpu_overlap_compute_collective_tc=true \\\n--xla_enable_async_all_gather=true \\\n--xla_tpu_scoped_vmem_limit_kib=65536 \\\n--xla_tpu_enable_async_all_to_all=true \\\n--xla_tpu_enable_all_experimental_scheduler_features=true \\\n--xla_tpu_enable_scheduler_memory_pressure_tracking=true \\\n--xla_tpu_host_transfer_overlap_limit=24 \\\n--xla_tpu_aggressive_opt_barrier_removal=ENABLED \\\n--xla_lhs_prioritize_async_depth_over_stall=ENABLED \\\n--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\\n--xla_should_add_loop_invariant_op_in_chain=ENABLED \\\n--xla_max_concurrent_host_send_recv=100 \\\n--xla_tpu_scheduler_percent_shared_memory_limit=100 \\\n--xla_latency_hiding_scheduler_rerun=2 \\\n--xla_tpu_use_minor_sharding_for_major_trivial_input=true \\\n--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\\n--xla_tpu_assign_all_reduce_scatter_layout=true'\"\u003e\u003cpre\u003eLIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_megacore_fusion_allow_ags=false \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_collective_permute=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_ag_backward_pipelining=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_data_parallel_all_reduce_opt=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_data_parallel_opt_different_sized_ops=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_overlap_compute_collective_tc=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_all_gather=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_scoped_vmem_limit_kib=65536 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_all_to_all=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_all_experimental_scheduler_features=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_scheduler_memory_pressure_tracking=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_host_transfer_overlap_limit=24 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_aggressive_opt_barrier_removal=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_lhs_prioritize_async_depth_over_stall=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_should_add_loop_invariant_op_in_chain=ENABLED \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_max_concurrent_host_send_recv=100 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_scheduler_percent_shared_memory_limit=100 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_latency_hiding_scheduler_rerun=2 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_use_minor_sharding_for_major_trivial_input=true \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_assign_all_reduce_scatter_layout=true\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python3 ~/xpk/xpk.py workload create \\\n--cluster=$CLUSTER_NAME \\\n--project=$PROJECT \\\n--zone=$ZONE \\\n--device-type=$DEVICE_TYPE \\\n--num-slices=1 \\\n--command=\u0026quot; \\\nHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \\\nsrc/maxdiffusion/configs/base_wan_14b.yml \\\nattention='flash' \\\nweights_dtype=bfloat16 \\\nactivations_dtype=bfloat16 \\\nguidance_scale=5.0 \\\nflow_shift=5.0 \\\nfps=16 \\\nskip_jax_distributed_system=False \\\nrun_name=${RUN_NAME} \\\noutput_dir=${OUTPUT_DIR} \\\ntrain_data_dir=${DATASET_DIR} \\\nload_tfrecord_cached=True \\\nheight=1280 \\\nwidth=720 \\\nnum_frames=81 \\\nnum_inference_steps=50 \\\njax_cache_dir=${OUTPUT_DIR}/jax_cache/ \\\nenable_profiler=True \\\ndataset_save_location=${SAVE_DATASET_DIR} \\\nremat_policy='HIDDEN_STATE_WITH_OFFLOAD' \\\nflash_min_seq_length=0 \\\nseed=$RANDOM \\\nskip_first_n_steps_for_profiler=3 \\\nprofiler_steps=3 \\\nper_device_batch_size=0.25 \\\nici_data_parallelism=32 \\\nici_fsdp_parallelism=4 \\\nici_tensor_parallelism=1 \\\nmax_train_steps=5000 \\\neval_every=100 \\\neval_data_dir=${EVAL_DATA_DIR} \\\nenable_generate_video_for_eval=True\u0026quot; \\\n--base-docker-image=${IMAGE_DIR} \\\n--enable-debug-logs \\\n--workload=${RUN_NAME} \\\n--priority=medium \\\n--max-restarts=0\"\u003e\u003cpre\u003epython3 \u003cspan class=\"pl-k\"\u003e~\u003c/span\u003e/xpk/xpk.py workload create \\\n--cluster=\u003cspan class=\"pl-smi\"\u003e$CLUSTER_NAME\u003c/span\u003e \\\n--project=\u003cspan class=\"pl-smi\"\u003e$PROJECT\u003c/span\u003e \\\n--zone=\u003cspan class=\"pl-smi\"\u003e$ZONE\u003c/span\u003e \\\n--device-type=\u003cspan class=\"pl-smi\"\u003e$DEVICE_TYPE\u003c/span\u003e \\\n--num-slices=1 \\\n--command=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003esrc/maxdiffusion/configs/base_wan_14b.yml \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eattention='flash' \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eweights_dtype=bfloat16 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eactivations_dtype=bfloat16 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eguidance_scale=5.0 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eflow_shift=5.0 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003efps=16 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eskip_jax_distributed_system=False \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003erun_name=\u003cspan class=\"pl-smi\"\u003e${RUN_NAME}\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eoutput_dir=\u003cspan class=\"pl-smi\"\u003e${OUTPUT_DIR}\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003etrain_data_dir=\u003cspan class=\"pl-smi\"\u003e${DATASET_DIR}\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eload_tfrecord_cached=True \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eheight=1280 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003ewidth=720 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003enum_frames=81 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003enum_inference_steps=50 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003ejax_cache_dir=\u003cspan class=\"pl-smi\"\u003e${OUTPUT_DIR}\u003c/span\u003e/jax_cache/ \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eenable_profiler=True \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003edataset_save_location=\u003cspan class=\"pl-smi\"\u003e${SAVE_DATASET_DIR}\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eremat_policy='HIDDEN_STATE_WITH_OFFLOAD' \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eflash_min_seq_length=0 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eseed=\u003cspan class=\"pl-smi\"\u003e$RANDOM\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eskip_first_n_steps_for_profiler=3 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eprofiler_steps=3 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eper_device_batch_size=0.25 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eici_data_parallelism=32 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eici_fsdp_parallelism=4 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eici_tensor_parallelism=1 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003emax_train_steps=5000 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eeval_every=100 \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eeval_data_dir=\u003cspan class=\"pl-smi\"\u003e${EVAL_DATA_DIR}\u003c/span\u003e \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eenable_generate_video_for_eval=True\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\n--base-docker-image=\u003cspan class=\"pl-smi\"\u003e${IMAGE_DIR}\u003c/span\u003e \\\n--enable-debug-logs \\\n--workload=\u003cspan class=\"pl-smi\"\u003e${RUN_NAME}\u003c/span\u003e \\\n--priority=medium \\\n--max-restarts=0\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFlux Training\u003c/h2\u003e\u003ca id=\"user-content-flux-training\" class=\"anchor\" aria-label=\"Permalink: Flux Training\" href=\"#flux-training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eExpected results on 1024 x 1024 images with flash attention and bfloat16:\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eModel\u003c/th\u003e\n\u003cth\u003eAccelerator\u003c/th\u003e\n\u003cth\u003eSharding Strategy\u003c/th\u003e\n\u003cth\u003ePer Device Batch Size\u003c/th\u003e\n\u003cth\u003eGlobal Batch Size\u003c/th\u003e\n\u003cth\u003eStep Time (secs)\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-dev\u003c/td\u003e\n\u003ctd\u003ev5p-8\u003c/td\u003e\n\u003ctd\u003eFSDP\u003c/td\u003e\n\u003ctd\u003e2\u003c/td\u003e\n\u003ctd\u003e8\u003c/td\u003e\n\u003ctd\u003e1.769\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eFlux finetuning has only been tested on TPU v5p.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo run the Flux training benchmark on v5p-8, use:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/train_flux.py src/maxdiffusion/configs/base_flux_dev.yml \\\n    run_name=\u0026quot;flux-training\u0026quot; \\\n    output_dir=\u0026quot;gs://\u0026lt;your-gcs-bucket\u0026gt;/\u0026quot; \\\n    jax_cache_dir=\u0026quot;/tmp/jax_cache\u0026quot; \\\n    save_final_checkpoint=False \\\n    max_train_steps=100 \\\n    dataset_type=synthetic \\\n    ici_data_parallelism=1 \\\n    ici_fsdp_parallelism=4 \\\n    ici_tensor_parallelism=1 \\\n    train_new_flux=True \\\n    resolution=1024 \\\n    attention_sharding_uniform=False \\\n    attention=tokamax_flash \\\n    per_device_batch_size=2 \\\n    enable_profiler=False \\\n    reuse_example_batch=True \\\n    write_metrics=False \\\n    use_base2_exp=True\"\u003e\u003cpre\u003epython src/maxdiffusion/train_flux.py src/maxdiffusion/configs/base_flux_dev.yml \\\n    run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eflux-training\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\n    output_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003egs://\u0026lt;your-gcs-bucket\u0026gt;/\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\n    jax_cache_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e/tmp/jax_cache\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\n    save_final_checkpoint=False \\\n    max_train_steps=100 \\\n    dataset_type=synthetic \\\n    ici_data_parallelism=1 \\\n    ici_fsdp_parallelism=4 \\\n    ici_tensor_parallelism=1 \\\n    train_new_flux=True \\\n    resolution=1024 \\\n    attention_sharding_uniform=False \\\n    attention=tokamax_flash \\\n    per_device_batch_size=2 \\\n    enable_profiler=False \\\n    reuse_example_batch=True \\\n    write_metrics=False \\\n    use_base2_exp=True\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo generate images with a finetuned checkpoint, run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux_pipeline.py src/maxdiffusion/configs/base_flux_dev.yml  run_name=\u0026quot;test-flux-train\u0026quot; output_dir=\u0026quot;gs://\u0026lt;your-gcs-bucket\u0026gt;/\u0026quot; jax_cache_dir=\u0026quot;/tmp/jax_cache\u0026quot;\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux_pipeline.py src/maxdiffusion/configs/base_flux_dev.yml  run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etest-flux-train\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e output_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003egs://\u0026lt;your-gcs-bucket\u0026gt;/\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e jax_cache_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e/tmp/jax_cache\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion XL Training\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-xl-training\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion XL Training\" href=\"#stable-diffusion-xl-training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export LIBTPU_INIT_ARGS=\u0026quot;\u0026quot;\npython -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\u0026quot;my_xl_run\u0026quot; output_dir=\u0026quot;gs://your-bucket/\u0026quot; per_device_batch_size=1\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e LIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\npython -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_xl_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e output_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003egs://your-bucket/\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOn GPUS with Fused Attention:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFirst install Transformer Engine by following the \u003ca href=\"#fused-attention-for-gpu\"\u003einstructions here\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"NVTE_FUSED_ATTN=1 python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml hardware=gpu run_name='test-sdxl-train' output_dir=/tmp/ train_new_unet=true train_text_encoder=false cache_latents_text_encoder_outputs=true max_train_steps=200 weights_dtype=bfloat16 resolution=512 per_device_batch_size=1 attention=\u0026quot;cudnn_flash_te\u0026quot; jit_initializers=False\"\u003e\u003cpre\u003eNVTE_FUSED_ATTN=1 python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml hardware=gpu run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003etest-sdxl-train\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e output_dir=/tmp/ train_new_unet=true train_text_encoder=false cache_latents_text_encoder_outputs=true max_train_steps=200 weights_dtype=bfloat16 resolution=512 per_device_batch_size=1 attention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecudnn_flash_te\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e jit_initializers=False\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo generate images with a trained checkpoint, run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_xl.yml run_name=\u0026quot;my_run\u0026quot; pretrained_model_name_or_path=\u0026lt;your_saved_checkpoint_path\u0026gt; from_pt=False attention=dot_product\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate src/maxdiffusion/configs/base_xl.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e pretrained_model_name_or_path=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour_saved_checkpoint_path\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e from_pt=False attention=dot_product\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion 2 base Training\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-2-base-training\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion 2 base Training\" href=\"#stable-diffusion-2-base-training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export LIBTPU_INIT_ARGS=\u0026quot;\u0026quot;\npython -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=\u0026quot;my_run\u0026quot; jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e LIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\npython -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion 1.4 Training\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-14-training\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion 1.4 Training\" href=\"#stable-diffusion-14-training\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export LIBTPU_INIT_ARGS=\u0026quot;\u0026quot;\npython -m src.maxdiffusion.train src/maxdiffusion/configs/base14.yml run_name=\u0026quot;my_run\u0026quot; jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e LIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\npython -m src.maxdiffusion.train src/maxdiffusion/configs/base14.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo generate images with a trained checkpoint, run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\u0026quot;my_run\u0026quot; output_dir=gs://your-bucket/ from_pt=False attention=dot_product\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e output_dir=gs://your-bucket/ from_pt=False attention=dot_product\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDreambooth\u003c/h2\u003e\u003ca id=\"user-content-dreambooth\" class=\"anchor\" aria-label=\"Permalink: Dreambooth\" href=\"#dreambooth\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSupported models are \u003cstrong\u003eStable Diffusion 1.x,2.x\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/dreambooth/train_dreambooth.py src/maxdiffusion/configs/base14.yml class_data_dir=\u0026lt;your-class-dir\u0026gt; instance_data_dir=\u0026lt;your-instance-dir\u0026gt; instance_prompt=\u0026quot;a photo of ohwx dog\u0026quot; class_prompt=\u0026quot;photo of a dog\u0026quot; max_train_steps=150 jax_cache_dir=\u0026lt;your-cache-dir\u0026gt; class_prompt=\u0026quot;a photo of a dog\u0026quot; activations_dtype=bfloat16 weights_dtype=float32 per_device_batch_size=1 enable_profiler=False precision=DEFAULT cache_dreambooth_dataset=False learning_rate=4e-6 num_class_images=100 run_name=\u0026lt;your-run-name\u0026gt; output_dir=gs://\u0026lt;your-bucket-name\u0026gt;\"\u003e\u003cpre\u003epython src/maxdiffusion/dreambooth/train_dreambooth.py src/maxdiffusion/configs/base14.yml class_data_dir=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-class-dir\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e instance_data_dir=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-instance-dir\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e instance_prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ea photo of ohwx dog\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e class_prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ephoto of a dog\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e max_train_steps=150 jax_cache_dir=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-cache-dir\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e class_prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ea photo of a dog\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e activations_dtype=bfloat16 weights_dtype=float32 per_device_batch_size=1 enable_profiler=False precision=DEFAULT cache_dreambooth_dataset=False learning_rate=4e-6 num_class_images=100 run_name=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-run-name\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e output_dir=gs://\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-bucket-name\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInference\u003c/h2\u003e\u003ca id=\"user-content-inference\" class=\"anchor\" aria-label=\"Permalink: Inference\" href=\"#inference\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo generate images, run the following command:\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion XL\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-xl\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion XL\" href=\"#stable-diffusion-xl\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSingle and Multi host inference is supported with sharding annotations:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\u0026quot;my_run\u0026quot;\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSingle host pmap version:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate_sdxl_replicated\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate_sdxl_replicated\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion 2 base\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-2-base\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion 2 base\" href=\"#stable-diffusion-2-base\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\u0026quot;my_run\u0026quot;\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion 2.1\u003c/h2\u003e\u003ca id=\"user-content-stable-diffusion-21\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion 2.1\" href=\"#stable-diffusion-21\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate src/maxdiffusion/configs/base21.yml run_name=\u0026quot;my_run\u0026quot;\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate src/maxdiffusion/configs/base21.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLTX-Video\u003c/h2\u003e\u003ca id=\"user-content-ltx-video\" class=\"anchor\" aria-label=\"Permalink: LTX-Video\" href=\"#ltx-video\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn the folder src/maxdiffusion/models/ltx_video/utils, run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python convert_torch_weights_to_jax.py --ckpt_path [LOCAL DIRECTORY FOR WEIGHTS] --transformer_config_path ../ltxv-13B.json\"\u003e\u003cpre\u003epython convert_torch_weights_to_jax.py --ckpt_path [LOCAL DIRECTORY FOR WEIGHTS] --transformer_config_path ../ltxv-13B.json\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn the repo folder, run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_ltx_video.py src/maxdiffusion/configs/ltx_video.yml output_dir=\u0026quot;[SAME DIRECTORY]\u0026quot; config_path=\u0026quot;src/maxdiffusion/models/ltx_video/ltxv-13B.json\u0026quot;\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_ltx_video.py src/maxdiffusion/configs/ltx_video.yml output_dir=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e[SAME DIRECTORY]\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e config_path=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esrc/maxdiffusion/models/ltx_video/ltxv-13B.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eImg2video Generation:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAdd conditioning image path as conditioning_media_paths in the form of [\"IMAGE_PATH\"] along with other generation parameters in the ltx_video.yml file. Then follow same instruction as above.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLTX-2 Video\u003c/h2\u003e\u003ca id=\"user-content-ltx-2-video\" class=\"anchor\" aria-label=\"Permalink: LTX-2 Video\" href=\"#ltx-2-video\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAlthough not required, attaching an external disk is recommended as weights take up a lot of disk space. \u003ca href=\"https://cloud.google.com/tpu/docs/attach-durable-block-storage\" rel=\"nofollow\"\u003eFollow these instructions if you would like to attach an external disk\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe following command will run LTX-2 T2V:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u0026quot;--xla_tpu_enable_async_collective_fusion=true \\\n--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\\n--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\n--xla_tpu_overlap_compute_collective_tc=true \\\n--xla_enable_async_all_reduce=true\u0026quot; \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_ltx2.py \\\nsrc/maxdiffusion/configs/ltx2_video.yml \\\nattention=\u0026quot;flash\u0026quot; \\\nnum_inference_steps=40 \\\nnum_frames=121 \\\nwidth=768 \\\nheight=512 \\\nper_device_batch_size=.125 \\\nici_data_parallelism=2 \\\nici_context_parallelism=4 \\\nrun_name=ltx2-inference\"\u003e\u003cpre\u003eHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e--xla_tpu_enable_async_collective_fusion=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_multiple_steps=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_overlap_compute_collective_tc=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_all_reduce=true\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_ltx2.py \\\nsrc/maxdiffusion/configs/ltx2_video.yml \\\nattention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eflash\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nnum_inference_steps=40 \\\nnum_frames=121 \\\nwidth=768 \\\nheight=512 \\\nper_device_batch_size=.125 \\\nici_data_parallelism=2 \\\nici_context_parallelism=4 \\\nrun_name=ltx2-inference\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWan Models\u003c/h2\u003e\u003ca id=\"user-content-wan-models\" class=\"anchor\" aria-label=\"Permalink: Wan Models\" href=\"#wan-models\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAlthough not required, attaching an external disk is recommended as weights take up a lot of disk space. \u003ca href=\"https://cloud.google.com/tpu/docs/attach-durable-block-storage\" rel=\"nofollow\"\u003eFollow these instructions if you would like to attach an external disk\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSupports both Text2Vid and Img2Vid pipelines.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eNote\u003c/strong\u003e: The product of per_device_batch_size and num_devices must be equal to a whole number.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe below command uses 4 devices and a per_device_batch_size=0.25. Thus, 4 * 0.25 = 1. This will generate a single video. Setting per_device_batch_size to 0.5, will generate 2 videos and so on.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf using 8 devices, then per_device_batch_size=0.125 will generate 1 video, per_device_batch_size=0.25 generates 2 videos.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe following command will run Wan2.1 T2V:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u0026quot;--xla_tpu_enable_async_collective_fusion=true \\\n--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\\n--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\n--xla_tpu_overlap_compute_collective_tc=true \\\n--xla_enable_async_all_reduce=true\u0026quot; \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_14b.yml \\\nattention=\u0026quot;flash\u0026quot; \\\nnum_inference_steps=50 \\\nnum_frames=81 \\\nwidth=1280 \\\nheight=720 \\\njax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\\nper_device_batch_size=.0.25 \\\nici_data_parallelism=2 \\\nici_context_parallelism=2 \\\nflow_shift=5.0 \\\nenable_profiler=True \\\nrun_name=wan-inference-testing-720p \\\noutput_dir=gs:/jfacevedo-maxdiffusion \\\nfps=16 \\\nflash_min_seq_length=0 \\\nflash_block_sizes='{\u0026quot;block_q\u0026quot; : 3024, \u0026quot;block_kv_compute\u0026quot; : 1024, \u0026quot;block_kv\u0026quot; : 2048, \u0026quot;block_q_dkv\u0026quot;: 3024, \u0026quot;block_kv_dkv\u0026quot; : 2048, \u0026quot;block_kv_dkv_compute\u0026quot; : 2048, \u0026quot;block_q_dq\u0026quot; : 3024, \u0026quot;block_kv_dq\u0026quot; : 2048 }' \\\nseed=118445\"\u003e\u003cpre\u003eHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e--xla_tpu_enable_async_collective_fusion=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_multiple_steps=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_overlap_compute_collective_tc=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_all_reduce=true\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_14b.yml \\\nattention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eflash\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nnum_inference_steps=50 \\\nnum_frames=81 \\\nwidth=1280 \\\nheight=720 \\\njax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\\nper_device_batch_size=.0.25 \\\nici_data_parallelism=2 \\\nici_context_parallelism=2 \\\nflow_shift=5.0 \\\nenable_profiler=True \\\nrun_name=wan-inference-testing-720p \\\noutput_dir=gs:/jfacevedo-maxdiffusion \\\nfps=16 \\\nflash_min_seq_length=0 \\\nflash_block_sizes=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"block_q\" : 3024, \"block_kv_compute\" : 1024, \"block_kv\" : 2048, \"block_q_dkv\": 3024, \"block_kv_dkv\" : 2048, \"block_kv_dkv_compute\" : 2048, \"block_q_dq\" : 3024, \"block_kv_dq\" : 2048 }\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e \\\nseed=118445\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo run other Wan model inference pipelines, change the config file in the command above:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eFor Wan2.1 I2V, use \u003ccode\u003ebase_wan_i2v_14b.yml\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eFor Wan2.2 T2V, use \u003ccode\u003ebase_wan_27b.yml\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eFor Wan2.2 I2V, use \u003ccode\u003ebase_wan_i2v_27b.yml\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUlysses Attention\u003c/h3\u003e\u003ca id=\"user-content-ulysses-attention\" class=\"anchor\" aria-label=\"Permalink: Ulysses Attention\" href=\"#ulysses-attention\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMaxDiffusion supports Ulysses attention for WAN TPU inference. Enable it by setting \u003ccode\u003eattention=\"ulysses\"\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eInternally, this follows the Ulysses sequence-parallel attention pattern and trades sequence shards for head shards around the local TPU splash kernel. For background, see \u003ca href=\"https://arxiv.org/abs/2309.14509\" rel=\"nofollow\"\u003eDeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo enable Ulysses attention, set the corresponding override in your config YAML or pass it as a command-line override:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nattention=\u0026quot;ulysses\u0026quot; \\\nici_context_parallelism=4 \\\n...\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nattention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eulysses\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nici_context_parallelism=4 \\\n...\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUlysses requires \u003ccode\u003eici_context_parallelism\u003c/code\u003e greater than 1, and the number of attention heads must be divisible by the context shard count. \u003ccode\u003eflash_block_sizes\u003c/code\u003e tuning is optional and can still be used for hardware-specific tuning.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIn our Wan2.2 I2V benchmarks at 40 inference steps, 81 frames, and \u003ccode\u003e720x1280\u003c/code\u003e resolution, Ulysses improved inference time by roughly \u003ccode\u003e~10%\u003c/code\u003e compared with flash attention, with about \u003ccode\u003e~20s\u003c/code\u003e lower latency on the v6e-8 and v7x-8 TPU setup.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eChunked Ulysses Attention (Overlapping Communication and Compute)\u003c/h4\u003e\u003ca id=\"user-content-chunked-ulysses-attention-overlapping-communication-and-compute\" class=\"anchor\" aria-label=\"Permalink: Chunked Ulysses Attention (Overlapping Communication and Compute)\" href=\"#chunked-ulysses-attention-overlapping-communication-and-compute\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you observe a major \u003ccode\u003eall-to-all\u003c/code\u003e communication bottleneck (especially when communication overhead is more pronounced compared to attention computation), you can enable \u003cstrong\u003eChunked Ulysses Attention\u003c/strong\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eBy setting \u003ccode\u003eulysses_attention_chunks\u003c/code\u003e greater than 1, MaxDiffusion splits the Ulysses all-to-all communication and attention computation into head-group passes (chunks). This allows XLA to overlap the all-to-all communication of one chunk with the head-parallel local attention compute of another chunk, significantly mitigating the communication bottleneck.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis chunking technique is supported and works for both plain Ulysses attention (\u003ccode\u003eattention=\"ulysses\"\u003c/code\u003e) and hybrid Ulysses+Ring 2D attention/context parallelism (\u003ccode\u003eattention=\"ulysses_ring\"\u003c/code\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo enable chunked Ulysses attention, set the corresponding override (e.g. \u003ccode\u003eulysses_attention_chunks=2\u003c/code\u003e or \u003ccode\u003eulysses_attention_chunks=5\u003c/code\u003e) in your config YAML or command line:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nattention=\u0026quot;ulysses\u0026quot; \\\nici_context_parallelism=4 \\\nulysses_attention_chunks=2 \\\n...\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nattention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eulysses\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nici_context_parallelism=4 \\\nulysses_attention_chunks=2 \\\n...\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-alert markdown-alert-important\" dir=\"auto\"\u003e\u003cp class=\"markdown-alert-title\" dir=\"auto\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-report mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"\u003e\u003c/path\u003e\u003c/svg\u003eImportant\u003c/p\u003e\u003cp dir=\"auto\"\u003eFor communication-compute overlap to be effective on TPUs, you must enable the following XLA flags before running:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export XLA_FLAGS=\u0026quot;--xla_tpu_enable_async_all_to_all=true --xla_tpu_overlap_compute_collective_tc=true\u0026quot;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eexport\u003c/span\u003e XLA_FLAGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e--xla_tpu_enable_async_all_to_all=true --xla_tpu_overlap_compute_collective_tc=true\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCaching Mechanisms\u003c/h3\u003e\u003ca id=\"user-content-caching-mechanisms\" class=\"anchor\" aria-label=\"Permalink: Caching Mechanisms\" href=\"#caching-mechanisms\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWan 2.x pipelines support several caching strategies to accelerate inference by skipping redundant transformer forward passes. These are \u003cstrong\u003emutually exclusive\u003c/strong\u003e — enable only one at a time.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eCache Type\u003c/th\u003e\n\u003cth\u003eConfig Flag\u003c/th\u003e\n\u003cth\u003eSupported Pipelines\u003c/th\u003e\n\u003cth\u003eSpeedup\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eCFG Cache\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003euse_cfg_cache: True\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWan 2.1 T2V, Wan 2.2 T2V/I2V\u003c/td\u003e\n\u003ctd\u003e~1.2x\u003c/td\u003e\n\u003ctd\u003eFasterCache-style: caches the unconditional branch and applies FFT frequency-domain compensation on skipped steps.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eSenCache\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003euse_sen_cache: True\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWan 2.2 T2V/I2V\u003c/td\u003e\n\u003ctd\u003e~1.4x\u003c/td\u003e\n\u003ctd\u003eSensitivity-Aware Caching (\u003ca href=\"https://arxiv.org/abs/2602.24208\" rel=\"nofollow\"\u003earXiv:2602.24208\u003c/a\u003e): predicts output change via first-order sensitivity S = α_x·‖Δx‖ + α_t·|Δt|. Skips the full CFG forward pass when predicted change is below tolerance ε.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eMagCache\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003euse_magcache: True\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWan 2.1 T2V, Wan 2.2 T2V/I2V\u003c/td\u003e\n\u003ctd\u003e~1.75–1.9x\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://github.com/Zehong-Ma/MagCache\"\u003eMagCache\u003c/a\u003e: skips the transformer blocks and reuses the cached block residual when the accumulated magnitude-ratio error stays below \u003ccode\u003emagcache_thresh\u003c/code\u003e, capped at \u003ccode\u003emagcache_K\u003c/code\u003e consecutive skips. Uses a precalibrated per-step \u003ccode\u003emag_ratios_base\u003c/code\u003e curve, so the skip schedule is deterministic (no data-dependent control flow).\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eFor Wan 2.2 (dual-transformer), MagCache uses a single \u003ccode\u003emag_ratios_base\u003c/code\u003e curve across both phases, forces a full recompute for the first \u003ccode\u003eretention_ratio\u003c/code\u003e fraction of each phase, and resets the cached residual at the high→low boundary. The shipped curves are seeded from the official Wan2.2 values (\u003ccode\u003ebase_wan_27b.yml\u003c/code\u003e for T2V, \u003ccode\u003ebase_wan_i2v_27b.yml\u003c/code\u003e for I2V); recalibrate for your dtype/attention kernel to tighten the quality gap.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eWan 2.2 T2V requires \u003ccode\u003eflow_shift=12.0\u003c/code\u003e\u003c/strong\u003e — it sets where the high→low boundary lands, which is what \u003ccode\u003emag_ratios_base\u003c/code\u003e is calibrated against. A lower shift (e.g. \u003ccode\u003e5.0\u003c/code\u003e) moves the boundary out of phase, so MagCache skips at the wrong steps and quality drops.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eBenchmarks (7x, A14B, 720×1280, 81 frames, 40 steps, vs dense — SSIM/PSNR largely reflect trajectory divergence, not visible degradation):\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eVariant\u003c/th\u003e\n\u003cth\u003eSettings\u003c/th\u003e\n\u003cth\u003eSpeedup\u003c/th\u003e\n\u003cth\u003eSSIM / PSNR\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eT2V\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eflow_shift=12.0\u003c/code\u003e, \u003ccode\u003emagcache_thresh=0.04\u003c/code\u003e, \u003ccode\u003emagcache_K=2\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e~1.82× (18/40 skipped)\u003c/td\u003e\n\u003ctd\u003e0.72 / 21.8 dB\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eI2V\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eflow_shift=5.0\u003c/code\u003e, \u003ccode\u003eboundary_ratio=0.900\u003c/code\u003e, \u003ccode\u003emagcache_thresh=0.06\u003c/code\u003e, \u003ccode\u003emagcache_K=2\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e~1.75× (17/40 skipped)\u003c/td\u003e\n\u003ctd\u003e0.91 / 25.4 dB\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eTo enable a caching mechanism, set the corresponding flag in your config YAML or pass it as a command-line override:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Example: enable SenCache for Wan 2.2 T2V\npython src/maxdiffusion/generate_wan.py \\\n  src/maxdiffusion/configs/base_wan_27b.yml \\\n  use_sen_cache=True \\\n  ...\n\n# Example: enable CFG Cache for Wan 2.2 I2V\npython src/maxdiffusion/generate_wan.py \\\n  src/maxdiffusion/configs/base_wan_i2v_27b.yml \\\n  use_cfg_cache=True \\\n  ...\n\n# Example: enable MagCache for Wan 2.2 T2V\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_27b.yml \\\nuse_magcache=True \\\nmagcache_thresh=0.04 \\\nmagcache_K=2 \\\n...\n\n# Example: enable MagCache for Wan 2.2 I2V\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nuse_magcache=True \\\nmagcache_thresh=0.06 \\\nmagcache_K=2 \\\n...\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Example: enable SenCache for Wan 2.2 T2V\u003c/span\u003e\npython src/maxdiffusion/generate_wan.py \\\n  src/maxdiffusion/configs/base_wan_27b.yml \\\n  use_sen_cache=True \\\n  ...\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Example: enable CFG Cache for Wan 2.2 I2V\u003c/span\u003e\npython src/maxdiffusion/generate_wan.py \\\n  src/maxdiffusion/configs/base_wan_i2v_27b.yml \\\n  use_cfg_cache=True \\\n  ...\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Example: enable MagCache for Wan 2.2 T2V\u003c/span\u003e\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_27b.yml \\\nuse_magcache=True \\\nmagcache_thresh=0.04 \\\nmagcache_K=2 \\\n...\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Example: enable MagCache for Wan 2.2 I2V\u003c/span\u003e\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_27b.yml \\\nuse_magcache=True \\\nmagcache_thresh=0.06 \\\nmagcache_K=2 \\\n...\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eRing Attention\u003c/h3\u003e\u003ca id=\"user-content-ring-attention\" class=\"anchor\" aria-label=\"Permalink: Ring Attention\" href=\"#ring-attention\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe added ring attention support for Wan models. Below are the stats for one \u003ccode\u003e720p\u003c/code\u003e (81 frames) video generation (with CFG DP):\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eAccelerator\u003c/th\u003e\n\u003cth\u003eModel\u003c/th\u003e\n\u003cth\u003eAttention Type\u003c/th\u003e\n\u003cth\u003eInference Steps\u003c/th\u003e\n\u003cth\u003eSharding\u003c/th\u003e\n\u003cth\u003ee2e Generation Time\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-8\u003c/td\u003e\n\u003ctd\u003eWAN 2.1\u003c/td\u003e\n\u003ctd\u003eTokamax Flash\u003c/td\u003e\n\u003ctd\u003e50\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context4-tp1\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e249.3\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-8\u003c/td\u003e\n\u003ctd\u003eWAN 2.1\u003c/td\u003e\n\u003ctd\u003eTokamax Ring\u003c/td\u003e\n\u003ctd\u003e50\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context4-tp1\u003c/td\u003e\n\u003ctd\u003e252.4\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-8\u003c/td\u003e\n\u003ctd\u003eWAN 2.2\u003c/td\u003e\n\u003ctd\u003eTokamax Flash\u003c/td\u003e\n\u003ctd\u003e40\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context4-tp1\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e194.4\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-8\u003c/td\u003e\n\u003ctd\u003eWAN 2.2\u003c/td\u003e\n\u003ctd\u003eTokamax Ring\u003c/td\u003e\n\u003ctd\u003e40\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context4-tp1\u003c/td\u003e\n\u003ctd\u003e201.7\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eAccelerator\u003c/th\u003e\n\u003cth\u003eModel\u003c/th\u003e\n\u003cth\u003eAttention Type\u003c/th\u003e\n\u003cth\u003eInference Steps\u003c/th\u003e\n\u003cth\u003eSharding\u003c/th\u003e\n\u003cth\u003ee2e Generation Time\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-16\u003c/td\u003e\n\u003ctd\u003eWAN 2.1\u003c/td\u003e\n\u003ctd\u003eTokamax Flash\u003c/td\u003e\n\u003ctd\u003e50\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context8-tp1\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e127.1\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-16\u003c/td\u003e\n\u003ctd\u003eWAN 2.1\u003c/td\u003e\n\u003ctd\u003eTokamax Ring\u003c/td\u003e\n\u003ctd\u003e50\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context8-tp1\u003c/td\u003e\n\u003ctd\u003e137.2\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-16\u003c/td\u003e\n\u003ctd\u003eWAN 2.2\u003c/td\u003e\n\u003ctd\u003eTokamax Flash\u003c/td\u003e\n\u003ctd\u003e40\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context8-tp1\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e106.0\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ev7x-16\u003c/td\u003e\n\u003ctd\u003eWAN 2.2\u003c/td\u003e\n\u003ctd\u003eTokamax Ring\u003c/td\u003e\n\u003ctd\u003e40\u003c/td\u003e\n\u003ctd\u003edp2-fsdp1-context8-tp1\u003c/td\u003e\n\u003ctd\u003e137.5\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003e(* There are some known stability issues for ring attention on 16 TPUs, please use \u003ccode\u003etokamax_flash\u003c/code\u003e attention instead.)\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAutomatic Tile-Size Search\u003c/h3\u003e\u003ca id=\"user-content-automatic-tile-size-search\" class=\"anchor\" aria-label=\"Permalink: Automatic Tile-Size Search\" href=\"#automatic-tile-size-search\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe optimal attention tile sizes (\u003ccode\u003eblock_q\u003c/code\u003e / \u003ccode\u003eblock_kv\u003c/code\u003e) depend on the sequence length, VMEM, sharding, and accelerator, and the feasibility edge is a VMEM OOM with no clean closed form — so we tune them empirically. Passing \u003ccode\u003eenable_tile_search=true\u003c/code\u003e to \u003ccode\u003egenerate_wan.py\u003c/code\u003e runs a fast one-DiT-block grid search before inference and injects the winning block sizes into \u003ccode\u003eflash_block_sizes\u003c/code\u003e (\u003ccode\u003etile_search_mode=smart\u003c/code\u003e by default; the search is opt-in and off by default).  The core is model-agnostic (\u003ccode\u003eutils/tile_size_grid_search.py\u003c/code\u003e) with a per-model plug (\u003ccode\u003eutils/wan_block_benchmark.py\u003c/code\u003e), which also runs standalone via \u003ccode\u003epython -m maxdiffusion.utils.wan_block_benchmark ... --smart-search\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFlux\u003c/h2\u003e\u003ca id=\"user-content-flux\" class=\"anchor\" aria-label=\"Permalink: Flux\" href=\"#flux\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFirst make sure you have permissions to access the Flux repos in Huggingface.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eExpected results on 1024 x 1024 images with flash attention and bfloat16:\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eModel\u003c/th\u003e\n\u003cth\u003eAccelerator\u003c/th\u003e\n\u003cth\u003eSharding Strategy\u003c/th\u003e\n\u003cth\u003eBatch Size\u003c/th\u003e\n\u003cth\u003eSteps\u003c/th\u003e\n\u003cth\u003etime (secs)\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-dev\u003c/td\u003e\n\u003ctd\u003ev4-8\u003c/td\u003e\n\u003ctd\u003eDDP\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e28\u003c/td\u003e\n\u003ctd\u003e23\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-schnell\u003c/td\u003e\n\u003ctd\u003ev4-8\u003c/td\u003e\n\u003ctd\u003eDDP\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e2.2\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-dev\u003c/td\u003e\n\u003ctd\u003ev6e-4\u003c/td\u003e\n\u003ctd\u003eDDP\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e28\u003c/td\u003e\n\u003ctd\u003e5.5\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-schnell\u003c/td\u003e\n\u003ctd\u003ev6e-4\u003c/td\u003e\n\u003ctd\u003eDDP\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e0.8\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eFlux-schnell\u003c/td\u003e\n\u003ctd\u003ev6e-4\u003c/td\u003e\n\u003ctd\u003eFSDP\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e1.2\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eSchnell:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u0026quot;photograph of an electronics chip in the shape of a race car with trillium written on its side\u0026quot; per_device_batch_size=1\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ephotograph of an electronics chip in the shape of a race car with trillium written on its side\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDev:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u0026quot;photograph of an electronics chip in the shape of a race car with trillium written on its side\u0026quot; per_device_batch_size=1\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ephotograph of an electronics chip in the shape of a race car with trillium written on its side\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you are using a TPU v6e (Trillium), you can use optimized flash block sizes for faster inference. Uncomment Flux-dev \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/src/maxdiffusion/configs/base_flux_dev.yml#60\"\u003econfig\u003c/a\u003e and Flux-schnell \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/src/maxdiffusion/configs/base_flux_schnell.yml#68\"\u003econfig\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo keep text encoders, vae and transformer on HBM memory at all times, the following command shards the model across devices.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u0026quot;photograph of an electronics chip in the shape of a race car with trillium written on its side\u0026quot; per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ephotograph of an electronics chip in the shape of a race car with trillium written on its side\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFlux.2-Klein (4B \u0026amp; 9B)\u003c/h3\u003e\u003ca id=\"user-content-flux2-klein-4b--9b\" class=\"anchor\" aria-label=\"Permalink: Flux.2-Klein (4B \u0026amp; 9B)\" href=\"#flux2-klein-4b--9b\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFlux.2-Klein provides ultra-fast 4-step image generation using Qwen3 text embeddings and FLUX.2 transformer blocks.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eText-to-Image Generation:\u003c/h4\u003e\u003ca id=\"user-content-text-to-image-generation\" class=\"anchor\" aria-label=\"Permalink: Text-to-Image Generation:\" href=\"#text-to-image-generation\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFlux.2-Klein 4B:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein.yml run_name=flux2klein_4b prompt=\u0026quot;A detailed vector illustration of a robotic hummingbird\u0026quot;\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein.yml run_name=flux2klein_4b prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eA detailed vector illustration of a robotic hummingbird\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFlux.2-Klein 9B:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b prompt=\u0026quot;A detailed vector illustration of a robotic hummingbird\u0026quot;\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eA detailed vector illustration of a robotic hummingbird\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMulti-Reference Image Editing:\u003c/h4\u003e\u003ca id=\"user-content-multi-reference-image-editing\" class=\"anchor\" aria-label=\"Permalink: Multi-Reference Image Editing:\" href=\"#multi-reference-image-editing\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFlux.2-Klein supports multi-reference image editing conditioned on up to 4 reference images via the \u003ccode\u003eimage_paths\u003c/code\u003e CLI flag.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFlux.2-Klein 9B Image Editing:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_image_edit prompt=\u0026quot;change the lighting to evening\u0026quot; image_paths=\u0026quot;['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\u0026quot;\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_image_edit prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003echange the lighting to evening\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e image_paths=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe 9B model also supports KV-Cache for faster inference, and can be toggled with the \u003ccode\u003euse_kv=True\u003c/code\u003e CLI flag:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_kv_edit prompt=\u0026quot;change the lighting to evening\u0026quot; image_paths=\u0026quot;['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\u0026quot; use_kv=True\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_kv_edit prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003echange the lighting to evening\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e image_paths=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e use_kv=True\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFused Attention for GPU:\u003c/h2\u003e\u003ca id=\"user-content-fused-attention-for-gpu\" class=\"anchor\" aria-label=\"Permalink: Fused Attention for GPU:\" href=\"#fused-attention-for-gpu\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFused Attention for GPU is supported via TransformerEngine. Installation instructions:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cd maxdiffusion\npip install -U \u0026quot;jax[cuda12]\u0026quot;\npip install -r requirements.txt\npip install --upgrade torch torchvision\npip install \u0026quot;transformer_engine[jax]\npip install .\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003ecd\u003c/span\u003e maxdiffusion\npip install -U \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ejax[cuda12]\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\npip install -r requirements.txt\npip install --upgrade torch torchvision\npip install \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etransformer_engine[jax]\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003epip install .\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNow run the command:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"NVTE_FUSED_ATTN=1 HF_HUB_ENABLE_HF_TRANSFER=1 python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 split_head_dim=True per_device_batch_size=1 attention=\u0026quot;cudnn_flash_te\u0026quot; hardware=gpu\"\u003e\u003cpre\u003eNVTE_FUSED_ATTN=1 HF_HUB_ENABLE_HF_TRANSFER=1 python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eA cute corgi lives in a house made out of sushi, anime\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e num_inference_steps=28 split_head_dim=True per_device_batch_size=1 attention=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecudnn_flash_te\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e hardware=gpu\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eWan LoRA\u003c/h2\u003e\u003ca id=\"user-content-wan-lora\" class=\"anchor\" aria-label=\"Permalink: Wan LoRA\" href=\"#wan-lora\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDisclaimer: not all LoRA formats have been tested. Currently supports ComfyUI and AI Toolkit formats. If there is a specific LoRA that doesn't load, please let us know.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFirst create a copy of the relevant config file eg: \u003ccode\u003esrc/maxdiffusion/configs/base_wan_{*}.yml\u003c/code\u003e. Update the prompt and LoRA details in the config. Make sure to set \u003ccode\u003eenable_lora: True\u003c/code\u003e. Then run the following command:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u0026quot;--xla_tpu_enable_async_collective_fusion=true \\\n--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\\n--xla_tpu_enable_async_collective_fusion_multiple_steps=true \\\n--xla_tpu_overlap_compute_collective_tc=true \\\n--xla_enable_async_all_reduce=true\u0026quot; \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_14b.yml \\   # --\u0026gt; Change to your copy\njax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\\nper_device_batch_size=.125 \\\nici_data_parallelism=2 \\\nici_context_parallelism=2 \\\nrun_name=wan-lora-inference-testing-720p \\\noutput_dir=gs:/jfacevedo-maxdiffusion \\\nseed=118445 \\\nenable_lora=True \\\"\u003e\u003cpre\u003eHF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\\nLIBTPU_INIT_ARGS=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e--xla_tpu_enable_async_collective_fusion=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_enable_async_collective_fusion_multiple_steps=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_tpu_overlap_compute_collective_tc=true \u003cspan class=\"pl-cce\"\u003e\\\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e--xla_enable_async_all_reduce=true\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \\\nHF_HUB_ENABLE_HF_TRANSFER=1 \\\npython src/maxdiffusion/generate_wan.py \\\nsrc/maxdiffusion/configs/base_wan_i2v_14b.yml \u003cspan class=\"pl-cce\"\u003e\\ \u003c/span\u003e  \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e --\u0026gt; Change to your copy\u003c/span\u003e\njax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\\nper_device_batch_size=.125 \\\nici_data_parallelism=2 \\\nici_context_parallelism=2 \\\nrun_name=wan-lora-inference-testing-720p \\\noutput_dir=gs:/jfacevedo-maxdiffusion \\\nseed=118445 \\\nenable_lora=True \\\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLoading multiple LoRAs is supported as well.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFlux LoRA\u003c/h2\u003e\u003ca id=\"user-content-flux-lora\" class=\"anchor\" aria-label=\"Permalink: Flux LoRA\" href=\"#flux-lora\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDisclaimer: not all LoRA formats have been tested. If there is a specific LoRA that doesn't load, please let us know.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTested with \u003ca href=\"https://civitai.com/models/652699/amateur-photography-flux-dev\" rel=\"nofollow\"\u003eAmateur Photography\u003c/a\u003e and \u003ca href=\"https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main\" rel=\"nofollow\"\u003eXLabs-AI\u003c/a\u003e LoRA collection.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFirst download the LoRA file to a local directory, for example, \u003ccode\u003e/home/jfacevedo/anime_lora.safetensors\u003c/code\u003e. Then run as follows:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{\u0026quot;lora_model_name_or_path\u0026quot; : [\u0026quot;/home/jfacevedo/anime_lora.safetensors\u0026quot;], \u0026quot;weight_name\u0026quot; : [\u0026quot;anime_lora.safetensors\u0026quot;], \u0026quot;adapter_name\u0026quot; : [\u0026quot;anime\u0026quot;], \u0026quot;scale\u0026quot;: [0.8], \u0026quot;from_pt\u0026quot;: [\u0026quot;true\u0026quot;]}'\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eA cute corgi lives in a house made out of sushi, anime\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"lora_model_name_or_path\" : [\"/home/jfacevedo/anime_lora.safetensors\"], \"weight_name\" : [\"anime_lora.safetensors\"], \"adapter_name\" : [\"anime\"], \"scale\": [0.8], \"from_pt\": [\"true\"]}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLoading multiple LoRAs is supported as follows:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{\u0026quot;lora_model_name_or_path\u0026quot; : [\u0026quot;/home/jfacevedo/anime_lora.safetensors\u0026quot;, \u0026quot;/home/jfacevedo/amateurphoto-v6-forcu.safetensors\u0026quot;], \u0026quot;weight_name\u0026quot; : [\u0026quot;anime_lora.safetensors\u0026quot;,\u0026quot;amateurphoto-v6-forcu.safetensors\u0026quot;], \u0026quot;adapter_name\u0026quot; : [\u0026quot;anime\u0026quot;,\u0026quot;realistic\u0026quot;], \u0026quot;scale\u0026quot;: [0.6, 0.6], \u0026quot;from_pt\u0026quot;: [\u0026quot;true\u0026quot;,\u0026quot;true\u0026quot;]}'\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eA cute corgi lives in a house made out of sushi, anime\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"lora_model_name_or_path\" : [\"/home/jfacevedo/anime_lora.safetensors\", \"/home/jfacevedo/amateurphoto-v6-forcu.safetensors\"], \"weight_name\" : [\"anime_lora.safetensors\",\"amateurphoto-v6-forcu.safetensors\"], \"adapter_name\" : [\"anime\",\"realistic\"], \"scale\": [0.6, 0.6], \"from_pt\": [\"true\",\"true\"]}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHyper SDXL LoRA\u003c/h2\u003e\u003ca id=\"user-content-hyper-sdxl-lora\" class=\"anchor\" aria-label=\"Permalink: Hyper SDXL LoRA\" href=\"#hyper-sdxl-lora\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSupports Hyper-SDXL models from \u003ca href=\"https://huggingface.co/ByteDance/Hyper-SD\" rel=\"nofollow\"\u003eByteDance\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\u0026quot;test-lora\u0026quot; output_dir=/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=2 do_classifier_free_guidance=False prompt=\u0026quot;a photograph of a cat wearing a hat riding a skateboard in a park.\u0026quot; per_device_batch_size=1 pretrained_model_name_or_path=\u0026quot;Lykon/AAM_XL_AnimeMix\u0026quot; from_pt=True revision=main diffusion_scheduler_config='{\u0026quot;_class_name\u0026quot; : \u0026quot;FlaxDDIMScheduler\u0026quot;, \u0026quot;timestep_spacing\u0026quot; : \u0026quot;trailing\u0026quot;}' lora_config='{\u0026quot;lora_model_name_or_path\u0026quot; : [\u0026quot;ByteDance/Hyper-SD\u0026quot;], \u0026quot;weight_name\u0026quot; : [\u0026quot;Hyper-SDXL-2steps-lora.safetensors\u0026quot;], \u0026quot;adapter_name\u0026quot; : [\u0026quot;hyper-sdxl\u0026quot;], \u0026quot;scale\u0026quot;: [0.7], \u0026quot;from_pt\u0026quot;: [\u0026quot;true\u0026quot;]}'\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etest-lora\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e output_dir=/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=2 do_classifier_free_guidance=False prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ea photograph of a cat wearing a hat riding a skateboard in a park.\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1 pretrained_model_name_or_path=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eLykon/AAM_XL_AnimeMix\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e from_pt=True revision=main diffusion_scheduler_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"_class_name\" : \"FlaxDDIMScheduler\", \"timestep_spacing\" : \"trailing\"}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e lora_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"lora_model_name_or_path\" : [\"ByteDance/Hyper-SD\"], \"weight_name\" : [\"Hyper-SDXL-2steps-lora.safetensors\"], \"adapter_name\" : [\"hyper-sdxl\"], \"scale\": [0.7], \"from_pt\": [\"true\"]}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLoad Multiple LoRA\u003c/h2\u003e\u003ca id=\"user-content-load-multiple-lora\" class=\"anchor\" aria-label=\"Permalink: Load Multiple LoRA\" href=\"#load-multiple-lora\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSupports loading multiple LoRAs for inference. Both from local or from HuggingFace hub.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\u0026quot;test-lora\u0026quot; output_dir=/tmp/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=30 do_classifier_free_guidance=True prompt=\u0026quot;ultra detailed diagram blueprint of a papercut Sitting MaineCoon cat, wide canvas, ampereart, electrical diagram, bl3uprint, papercut\u0026quot; per_device_batch_size=1 diffusion_scheduler_config='{\u0026quot;_class_name\u0026quot; : \u0026quot;FlaxDDIMScheduler\u0026quot;, \u0026quot;timestep_spacing\u0026quot; : \u0026quot;trailing\u0026quot;}' lora_config='{\u0026quot;lora_model_name_or_path\u0026quot; : [\u0026quot;/home/jfacevedo/blueprintify-sd-xl-10.safetensors\u0026quot;,\u0026quot;TheLastBen/Papercut_SDXL\u0026quot;], \u0026quot;weight_name\u0026quot; : [\u0026quot;/home/jfacevedo/blueprintify-sd-xl-10.safetensors\u0026quot;,\u0026quot;papercut.safetensors\u0026quot;], \u0026quot;adapter_name\u0026quot; : [\u0026quot;blueprint\u0026quot;,\u0026quot;papercut\u0026quot;], \u0026quot;scale\u0026quot;: [0.8, 0.7], \u0026quot;from_pt\u0026quot;: [\u0026quot;true\u0026quot;, \u0026quot;true\u0026quot;]}'\"\u003e\u003cpre\u003epython src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etest-lora\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e output_dir=/tmp/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=30 do_classifier_free_guidance=True prompt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eultra detailed diagram blueprint of a papercut Sitting MaineCoon cat, wide canvas, ampereart, electrical diagram, bl3uprint, papercut\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e per_device_batch_size=1 diffusion_scheduler_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"_class_name\" : \"FlaxDDIMScheduler\", \"timestep_spacing\" : \"trailing\"}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e lora_config=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"lora_model_name_or_path\" : [\"/home/jfacevedo/blueprintify-sd-xl-10.safetensors\",\"TheLastBen/Papercut_SDXL\"], \"weight_name\" : [\"/home/jfacevedo/blueprintify-sd-xl-10.safetensors\",\"papercut.safetensors\"], \"adapter_name\" : [\"blueprint\",\"papercut\"], \"scale\": [0.8, 0.7], \"from_pt\": [\"true\", \"true\"]}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSDXL Lightning\u003c/h2\u003e\u003ca id=\"user-content-sdxl-lightning\" class=\"anchor\" aria-label=\"Permalink: SDXL Lightning\" href=\"#sdxl-lightning\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSingle and Multi host inference is supported with sharding annotations:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl_lightning.yml run_name=\u0026quot;my_run\u0026quot; lightning_repo=\u0026quot;ByteDance/SDXL-Lightning\u0026quot; lightning_ckpt=\u0026quot;sdxl_lightning_4step_unet.safetensors\u0026quot;\"\u003e\u003cpre\u003epython -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl_lightning.yml run_name=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003emy_run\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e lightning_repo=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eByteDance/SDXL-Lightning\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e lightning_ckpt=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esdxl_lightning_4step_unet.safetensors\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eControlNet\u003c/h2\u003e\u003ca id=\"user-content-controlnet\" class=\"anchor\" aria-label=\"Permalink: ControlNet\" href=\"#controlnet\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMight require installing extra libraries for opencv: \u003ccode\u003eapt-get update \u0026amp;\u0026amp; apt-get install ffmpeg libsm6 libxext6  -y\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion 1.4\u003c/h3\u003e\u003ca id=\"user-content-stable-diffusion-14\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion 1.4\" href=\"#stable-diffusion-14\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/controlnet/generate_controlnet_replicated.py\"\u003e\u003cpre\u003epython src/maxdiffusion/controlnet/generate_controlnet_replicated.py\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStable Diffusion XL\u003c/h3\u003e\u003ca id=\"user-content-stable-diffusion-xl-1\" class=\"anchor\" aria-label=\"Permalink: Stable Diffusion XL\" href=\"#stable-diffusion-xl-1\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python src/maxdiffusion/controlnet/generate_controlnet_sdxl_replicated.py\"\u003e\u003cpre\u003epython src/maxdiffusion/controlnet/generate_controlnet_sdxl_replicated.py\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGetting Started: Multihost development\u003c/h2\u003e\u003ca id=\"user-content-getting-started-multihost-development\" class=\"anchor\" aria-label=\"Permalink: Getting Started: Multihost development\" href=\"#getting-started-multihost-development\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMultihost training for Stable Diffusion 2 base can be run using the following command:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"TPU_NAME=\u0026lt;your-tpu-name\u0026gt;\nZONE=\u0026lt;your-zone\u0026gt;\nPROJECT_ID=\u0026lt;your-project-id\u0026gt;\ngcloud compute tpus tpu-vm ssh $TPU_NAME --zone=$ZONE --project $PROJECT_ID --worker=all --command=\u0026quot;\nexport LIBTPU_INIT_ARGS=\u0026quot;\u0026quot;\ngit clone https://github.com/google/maxdiffusion\ncd maxdiffusion\npip3 install jax[tpu] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html\npip3 install -r requirements.txt\npip3 install .\npython -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=my_run output_dir=gs://your-bucket/\u0026quot;\"\u003e\u003cpre\u003eTPU_NAME=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-tpu-name\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e\nZONE=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-zone\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e\nPROJECT_ID=\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003eyour-project-id\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e\ngcloud compute tpus tpu-vm ssh \u003cspan class=\"pl-smi\"\u003e$TPU_NAME\u003c/span\u003e --zone=\u003cspan class=\"pl-smi\"\u003e$ZONE\u003c/span\u003e --project \u003cspan class=\"pl-smi\"\u003e$PROJECT_ID\u003c/span\u003e --worker=all --command=\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003eexport LIBTPU_INIT_ARGS=\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003egit clone https://github.com/google/maxdiffusion\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003ecd maxdiffusion\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003epip3 install jax[tpu] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003epip3 install -r requirements.txt\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003epip3 install .\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003epython -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=my_run output_dir=gs://your-bucket/\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eComparison to Alternatives\u003c/h1\u003e\u003ca id=\"user-content-comparison-to-alternatives\" class=\"anchor\" aria-label=\"Permalink: Comparison to Alternatives\" href=\"#comparison-to-alternatives\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMaxDiffusion started as a fork of \u003ca href=\"https://github.com/huggingface/diffusers\"\u003eDiffusers\u003c/a\u003e, a Hugging Face diffusion library written in Python, Pytorch and Jax. MaxDiffusion is compatible with Hugging Face Jax models. MaxDiffusion is more complex and was designed to run distributed across TPU Pods.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDevelopment\u003c/h1\u003e\u003ca id=\"user-content-development\" class=\"anchor\" aria-label=\"Permalink: Development\" href=\"#development\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWhether you are forking MaxDiffusion for your own needs or intending to contribute back to the community, a full suite of tests can be found in \u003ccode\u003etests\u003c/code\u003e and \u003ccode\u003esrc/maxdiffusion/tests\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo run unit tests simply run:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"python -m pytest\"\u003e\u003cpre\u003epython -m pytest\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePre-commit Hooks\u003c/h3\u003e\u003ca id=\"user-content-pre-commit-hooks\" class=\"anchor\" aria-label=\"Permalink: Pre-commit Hooks\" href=\"#pre-commit-hooks\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe use \u003ca href=\"https://pre-commit.com/\" rel=\"nofollow\"\u003epre-commit\u003c/a\u003e to automatically check and format code before each commit (using \u003ccode\u003epyink\u003c/code\u003e, \u003ccode\u003eruff\u003c/code\u003e, \u003ccode\u003epylint\u003c/code\u003e, and general git hygiene checks).\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eImportant:\u003c/strong\u003e Make sure you are in your active virtual environment (e.g. \u003ccode\u003emaxdiffusion_venv\u003c/code\u003e or your active venv) before running \u003ccode\u003epre-commit install\u003c/code\u003e, so that hooks run using the environment's installed dependencies.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# 1. Activate your virtual environment first\nsource \u0026lt;path-to-venv\u0026gt;/bin/activate\n\n# 2. Install pre-commit (if not already installed)\npip install pre-commit\n\n# 3. Install git pre-commit hooks\npre-commit install\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e 1. Activate your virtual environment first\u003c/span\u003e\n\u003cspan class=\"pl-c1\"\u003esource\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003epath-to-venv\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e/bin/activate\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e 2. Install pre-commit (if not already installed)\u003c/span\u003e\npip install pre-commit\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e 3. Install git pre-commit hooks\u003c/span\u003e\npre-commit install\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOnce installed, pre-commit will automatically run on staged files whenever you run \u003ccode\u003egit commit\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can also run all pre-commit checks manually across the entire repository at any time:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pre-commit run --all-files\"\u003e\u003cpre\u003epre-commit run --all-files\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCode Style\u003c/h3\u003e\u003ca id=\"user-content-code-style\" class=\"anchor\" aria-label=\"Permalink: Code Style\" href=\"#code-style\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis project uses \u003ccode\u003epylint\u003c/code\u003e and \u003ccode\u003epyink\u003c/code\u003e to enforce code style. Before submitting a pull request, please ensure your code passes these checks by running:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bash code_style.sh\"\u003e\u003cpre\u003ebash code_style.sh\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis script will automatically format your code with \u003ccode\u003epyink\u003c/code\u003e and help you identify any remaining style issues.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe full suite of -end-to end tests is in \u003ccode\u003etests\u003c/code\u003e and \u003ccode\u003esrc/maxdiffusion/tests\u003c/code\u003e. We run them with a nightly cadance.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eProfiling\u003c/h2\u003e\u003ca id=\"user-content-profiling\" class=\"anchor\" aria-label=\"Permalink: Profiling\" href=\"#profiling\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo learn how to enable ML Diagnostics and XProf profiling for your runs, please see our \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/docs/profiling.md\"\u003eML Diagnostics Guide\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMetrics\u003c/h2\u003e\u003ca id=\"user-content-metrics\" class=\"anchor\" aria-label=\"Permalink: Metrics\" href=\"#metrics\"\u003e\u003csvg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo learn how to enable ML Diagnostics metrics tracking for your runs, please see our \u003ca href=\"/AI-Hypercomputer/maxdiffusion/blob/main/docs/metrics.md\"\u003eMetrics Guide\u003c/a\u003e.\u003c/p\u003e\n\u003c/article\u003e","richTextTruncated":false,"renderedFileInfo":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"What's new?","fully_qualified_name":"What's new?","kind":"section_1","ident_start":767,"ident_end":778,"extent_start":765,"extent_end":2434,"ident_utf16":{"start":{"line_number":18,"utf16_col":2},"end":{"line_number":18,"utf16_col":13}},"extent_utf16":{"start":{"line_number":18,"utf16_col":0},"end":{"line_number":41,"utf16_col":0}}},{"name":"Overview","fully_qualified_name":"Overview","kind":"section_1","ident_start":2436,"ident_end":2444,"extent_start":2434,"extent_end":3948,"ident_utf16":{"start":{"line_number":41,"utf16_col":2},"end":{"line_number":41,"utf16_col":10}},"extent_utf16":{"start":{"line_number":41,"utf16_col":0},"end":{"line_number":66,"utf16_col":0}}},{"name":"Table of Contents","fully_qualified_name":"Table of Contents","kind":"section_1","ident_start":3950,"ident_end":3967,"extent_start":3948,"extent_end":5210,"ident_utf16":{"start":{"line_number":66,"utf16_col":2},"end":{"line_number":66,"utf16_col":19}},"extent_utf16":{"start":{"line_number":66,"utf16_col":0},"end":{"line_number":102,"utf16_col":0}}},{"name":"Getting Started","fully_qualified_name":"Getting Started","kind":"section_1","ident_start":5212,"ident_end":5227,"extent_start":5210,"extent_end":45136,"ident_utf16":{"start":{"line_number":102,"utf16_col":2},"end":{"line_number":102,"utf16_col":17}},"extent_utf16":{"start":{"line_number":102,"utf16_col":0},"end":{"line_number":913,"utf16_col":0}}},{"name":"Getting Started:","fully_qualified_name":"Getting Started:","kind":"section_2","ident_start":5391,"ident_end":5407,"extent_start":5388,"extent_end":5523,"ident_utf16":{"start":{"line_number":108,"utf16_col":3},"end":{"line_number":108,"utf16_col":19}},"extent_utf16":{"start":{"line_number":108,"utf16_col":0},"end":{"line_number":112,"utf16_col":0}}},{"name":"NVIDIA DGX Spark","fully_qualified_name":"NVIDIA DGX Spark","kind":"section_2","ident_start":5526,"ident_end":5542,"extent_start":5523,"extent_end":5644,"ident_utf16":{"start":{"line_number":112,"utf16_col":3},"end":{"line_number":112,"utf16_col":19}},"extent_utf16":{"start":{"line_number":112,"utf16_col":0},"end":{"line_number":116,"utf16_col":0}}},{"name":"Training","fully_qualified_name":"Training","kind":"section_2","ident_start":5647,"ident_end":5655,"extent_start":5644,"extent_end":5713,"ident_utf16":{"start":{"line_number":116,"utf16_col":3},"end":{"line_number":116,"utf16_col":11}},"extent_utf16":{"start":{"line_number":116,"utf16_col":0},"end":{"line_number":120,"utf16_col":0}}},{"name":"Wan 2.1 Training","fully_qualified_name":"Wan 2.1 Training","kind":"section_2","ident_start":5718,"ident_end":5734,"extent_start":5713,"extent_end":18656,"ident_utf16":{"start":{"line_number":120,"utf16_col":5},"end":{"line_number":120,"utf16_col":21}},"extent_utf16":{"start":{"line_number":120,"utf16_col":0},"end":{"line_number":400,"utf16_col":0}}},{"name":"Dataset Preparation","fully_qualified_name":"Dataset Preparation","kind":"section_3","ident_start":6185,"ident_end":6204,"extent_start":6179,"extent_end":8522,"ident_utf16":{"start":{"line_number":128,"utf16_col":6},"end":{"line_number":128,"utf16_col":25}},"extent_utf16":{"start":{"line_number":128,"utf16_col":0},"end":{"line_number":186,"utf16_col":0}}},{"name":"Training on a Single VM","fully_qualified_name":"Training on a Single VM","kind":"section_3","ident_start":8528,"ident_end":8551,"extent_start":8522,"extent_end":15308,"ident_utf16":{"start":{"line_number":186,"utf16_col":6},"end":{"line_number":186,"utf16_col":29}},"extent_utf16":{"start":{"line_number":186,"utf16_col":0},"end":{"line_number":310,"utf16_col":0}}},{"name":"Deploying with XPK","fully_qualified_name":"Deploying with XPK","kind":"section_3","ident_start":15314,"ident_end":15332,"extent_start":15308,"extent_end":18656,"ident_utf16":{"start":{"line_number":310,"utf16_col":6},"end":{"line_number":310,"utf16_col":24}},"extent_utf16":{"start":{"line_number":310,"utf16_col":0},"end":{"line_number":400,"utf16_col":0}}},{"name":"Flux Training","fully_qualified_name":"Flux Training","kind":"section_2","ident_start":18661,"ident_end":18674,"extent_start":18656,"extent_end":20000,"ident_utf16":{"start":{"line_number":400,"utf16_col":5},"end":{"line_number":400,"utf16_col":18}},"extent_utf16":{"start":{"line_number":400,"utf16_col":0},"end":{"line_number":440,"utf16_col":0}}},{"name":"Stable Diffusion XL Training","fully_qualified_name":"Stable Diffusion XL Training","kind":"section_2","ident_start":20005,"ident_end":20033,"extent_start":20000,"extent_end":21012,"ident_utf16":{"start":{"line_number":440,"utf16_col":5},"end":{"line_number":440,"utf16_col":33}},"extent_utf16":{"start":{"line_number":440,"utf16_col":0},"end":{"line_number":461,"utf16_col":0}}},{"name":"Stable Diffusion 2 base Training","fully_qualified_name":"Stable Diffusion 2 base Training","kind":"section_2","ident_start":21017,"ident_end":21049,"extent_start":21012,"extent_end":21406,"ident_utf16":{"start":{"line_number":461,"utf16_col":5},"end":{"line_number":461,"utf16_col":37}},"extent_utf16":{"start":{"line_number":461,"utf16_col":0},"end":{"line_number":468,"utf16_col":0}}},{"name":"Stable Diffusion 1.4 Training","fully_qualified_name":"Stable Diffusion 1.4 Training","kind":"section_2","ident_start":21411,"ident_end":21440,"extent_start":21406,"extent_end":22025,"ident_utf16":{"start":{"line_number":468,"utf16_col":5},"end":{"line_number":468,"utf16_col":34}},"extent_utf16":{"start":{"line_number":468,"utf16_col":0},"end":{"line_number":481,"utf16_col":0}}},{"name":"Dreambooth","fully_qualified_name":"Dreambooth","kind":"section_2","ident_start":22030,"ident_end":22040,"extent_start":22025,"extent_end":22670,"ident_utf16":{"start":{"line_number":481,"utf16_col":5},"end":{"line_number":481,"utf16_col":15}},"extent_utf16":{"start":{"line_number":481,"utf16_col":0},"end":{"line_number":489,"utf16_col":0}}},{"name":"Inference","fully_qualified_name":"Inference","kind":"section_2","ident_start":22673,"ident_end":22682,"extent_start":22670,"extent_end":22731,"ident_utf16":{"start":{"line_number":489,"utf16_col":3},"end":{"line_number":489,"utf16_col":12}},"extent_utf16":{"start":{"line_number":489,"utf16_col":0},"end":{"line_number":492,"utf16_col":0}}},{"name":"Stable Diffusion XL","fully_qualified_name":"Stable Diffusion XL","kind":"section_2","ident_start":22736,"ident_end":22755,"extent_start":22731,"extent_end":23047,"ident_utf16":{"start":{"line_number":492,"utf16_col":5},"end":{"line_number":492,"utf16_col":24}},"extent_utf16":{"start":{"line_number":492,"utf16_col":0},"end":{"line_number":506,"utf16_col":0}}},{"name":"Stable Diffusion 2 base","fully_qualified_name":"Stable Diffusion 2 base","kind":"section_2","ident_start":23052,"ident_end":23075,"extent_start":23047,"extent_end":23190,"ident_utf16":{"start":{"line_number":506,"utf16_col":5},"end":{"line_number":506,"utf16_col":28}},"extent_utf16":{"start":{"line_number":506,"utf16_col":0},"end":{"line_number":511,"utf16_col":0}}},{"name":"Stable Diffusion 2.1","fully_qualified_name":"Stable Diffusion 2.1","kind":"section_2","ident_start":23195,"ident_end":23215,"extent_start":23190,"extent_end":23325,"ident_utf16":{"start":{"line_number":511,"utf16_col":5},"end":{"line_number":511,"utf16_col":25}},"extent_utf16":{"start":{"line_number":511,"utf16_col":0},"end":{"line_number":516,"utf16_col":0}}},{"name":"LTX-Video","fully_qualified_name":"LTX-Video","kind":"section_2","ident_start":23330,"ident_end":23339,"extent_start":23325,"extent_end":23987,"ident_utf16":{"start":{"line_number":516,"utf16_col":5},"end":{"line_number":516,"utf16_col":14}},"extent_utf16":{"start":{"line_number":516,"utf16_col":0},"end":{"line_number":531,"utf16_col":0}}},{"name":"LTX-2 Video","fully_qualified_name":"LTX-2 Video","kind":"section_2","ident_start":23992,"ident_end":24003,"extent_start":23987,"extent_end":24999,"ident_utf16":{"start":{"line_number":531,"utf16_col":5},"end":{"line_number":531,"utf16_col":16}},"extent_utf16":{"start":{"line_number":531,"utf16_col":0},"end":{"line_number":558,"utf16_col":0}}},{"name":"Wan Models","fully_qualified_name":"Wan Models","kind":"section_2","ident_start":25004,"ident_end":25014,"extent_start":24999,"extent_end":35046,"ident_utf16":{"start":{"line_number":558,"utf16_col":5},"end":{"line_number":558,"utf16_col":15}},"extent_utf16":{"start":{"line_number":558,"utf16_col":0},"end":{"line_number":727,"utf16_col":0}}},{"name":"Ulysses Attention","fully_qualified_name":"Ulysses Attention","kind":"section_3","ident_start":27139,"ident_end":27156,"extent_start":27135,"extent_end":29829,"ident_utf16":{"start":{"line_number":607,"utf16_col":6},"end":{"line_number":607,"utf16_col":23}},"extent_utf16":{"start":{"line_number":607,"utf16_col":2},"end":{"line_number":652,"utf16_col":0}}},{"name":"Chunked Ulysses Attention (Overlapping Communication and Compute)","fully_qualified_name":"Chunked Ulysses Attention (Overlapping Communication and Compute)","kind":"section_4","ident_start":28359,"ident_end":28424,"extent_start":28352,"extent_end":29829,"ident_utf16":{"start":{"line_number":627,"utf16_col":7},"end":{"line_number":627,"utf16_col":72}},"extent_utf16":{"start":{"line_number":627,"utf16_col":0},"end":{"line_number":652,"utf16_col":0}}},{"name":"Caching Mechanisms","fully_qualified_name":"Caching Mechanisms","kind":"section_3","ident_start":29835,"ident_end":29853,"extent_start":29829,"extent_end":33195,"ident_utf16":{"start":{"line_number":652,"utf16_col":6},"end":{"line_number":652,"utf16_col":24}},"extent_utf16":{"start":{"line_number":652,"utf16_col":0},"end":{"line_number":705,"utf16_col":0}}},{"name":"Ring Attention","fully_qualified_name":"Ring Attention","kind":"section_3","ident_start":33199,"ident_end":33213,"extent_start":33195,"extent_end":34321,"ident_utf16":{"start":{"line_number":705,"utf16_col":4},"end":{"line_number":705,"utf16_col":18}},"extent_utf16":{"start":{"line_number":705,"utf16_col":0},"end":{"line_number":723,"utf16_col":0}}},{"name":"Automatic Tile-Size Search","fully_qualified_name":"Automatic Tile-Size Search","kind":"section_3","ident_start":34325,"ident_end":34351,"extent_start":34321,"extent_end":35046,"ident_utf16":{"start":{"line_number":723,"utf16_col":4},"end":{"line_number":723,"utf16_col":30}},"extent_utf16":{"start":{"line_number":723,"utf16_col":0},"end":{"line_number":727,"utf16_col":0}}},{"name":"Flux","fully_qualified_name":"Flux","kind":"section_2","ident_start":35051,"ident_end":35055,"extent_start":35046,"extent_end":38418,"ident_utf16":{"start":{"line_number":727,"utf16_col":5},"end":{"line_number":727,"utf16_col":9}},"extent_utf16":{"start":{"line_number":727,"utf16_col":0},"end":{"line_number":794,"utf16_col":0}}},{"name":"Flux.2-Klein (4B \u0026 9B)","fully_qualified_name":"Flux.2-Klein (4B \u0026 9B)","kind":"section_3","ident_start":36941,"ident_end":36963,"extent_start":36935,"extent_end":38418,"ident_utf16":{"start":{"line_number":761,"utf16_col":6},"end":{"line_number":761,"utf16_col":28}},"extent_utf16":{"start":{"line_number":761,"utf16_col":0},"end":{"line_number":794,"utf16_col":0}}},{"name":"Text-to-Image Generation:","fully_qualified_name":"Text-to-Image Generation:","kind":"section_4","ident_start":37091,"ident_end":37116,"extent_start":37084,"extent_end":37559,"ident_utf16":{"start":{"line_number":765,"utf16_col":7},"end":{"line_number":765,"utf16_col":32}},"extent_utf16":{"start":{"line_number":765,"utf16_col":0},"end":{"line_number":779,"utf16_col":0}}},{"name":"Multi-Reference Image Editing:","fully_qualified_name":"Multi-Reference Image Editing:","kind":"section_4","ident_start":37566,"ident_end":37596,"extent_start":37559,"extent_end":38418,"ident_utf16":{"start":{"line_number":779,"utf16_col":7},"end":{"line_number":779,"utf16_col":37}},"extent_utf16":{"start":{"line_number":779,"utf16_col":0},"end":{"line_number":794,"utf16_col":0}}},{"name":"Fused Attention for GPU:","fully_qualified_name":"Fused Attention for GPU:","kind":"section_2","ident_start":38423,"ident_end":38447,"extent_start":38418,"extent_end":39143,"ident_utf16":{"start":{"line_number":794,"utf16_col":5},"end":{"line_number":794,"utf16_col":29}},"extent_utf16":{"start":{"line_number":794,"utf16_col":0},"end":{"line_number":811,"utf16_col":0}}},{"name":"Wan LoRA","fully_qualified_name":"Wan LoRA","kind":"section_2","ident_start":39148,"ident_end":39156,"extent_start":39143,"extent_end":40391,"ident_utf16":{"start":{"line_number":811,"utf16_col":5},"end":{"line_number":811,"utf16_col":13}},"extent_utf16":{"start":{"line_number":811,"utf16_col":0},"end":{"line_number":839,"utf16_col":0}}},{"name":"Flux LoRA","fully_qualified_name":"Flux LoRA","kind":"section_2","ident_start":40396,"ident_end":40405,"extent_start":40391,"extent_end":42055,"ident_utf16":{"start":{"line_number":839,"utf16_col":5},"end":{"line_number":839,"utf16_col":14}},"extent_utf16":{"start":{"line_number":839,"utf16_col":0},"end":{"line_number":857,"utf16_col":0}}},{"name":"Hyper SDXL LoRA","fully_qualified_name":"Hyper SDXL LoRA","kind":"section_2","ident_start":42060,"ident_end":42075,"extent_start":42055,"extent_end":42862,"ident_utf16":{"start":{"line_number":857,"utf16_col":5},"end":{"line_number":857,"utf16_col":20}},"extent_utf16":{"start":{"line_number":857,"utf16_col":0},"end":{"line_number":865,"utf16_col":0}}},{"name":"Load Multiple LoRA","fully_qualified_name":"Load Multiple LoRA","kind":"section_2","ident_start":42867,"ident_end":42885,"extent_start":42862,"extent_end":43782,"ident_utf16":{"start":{"line_number":865,"utf16_col":5},"end":{"line_number":865,"utf16_col":23}},"extent_utf16":{"start":{"line_number":865,"utf16_col":0},"end":{"line_number":873,"utf16_col":0}}},{"name":"SDXL Lightning","fully_qualified_name":"SDXL Lightning","kind":"section_2","ident_start":43787,"ident_end":43801,"extent_start":43782,"extent_end":44100,"ident_utf16":{"start":{"line_number":873,"utf16_col":5},"end":{"line_number":873,"utf16_col":19}},"extent_utf16":{"start":{"line_number":873,"utf16_col":0},"end":{"line_number":881,"utf16_col":0}}},{"name":"ControlNet","fully_qualified_name":"ControlNet","kind":"section_2","ident_start":44105,"ident_end":44115,"extent_start":44100,"extent_end":44472,"ident_utf16":{"start":{"line_number":881,"utf16_col":5},"end":{"line_number":881,"utf16_col":15}},"extent_utf16":{"start":{"line_number":881,"utf16_col":0},"end":{"line_number":897,"utf16_col":0}}},{"name":"Stable Diffusion 1.4","fully_qualified_name":"Stable Diffusion 1.4","kind":"section_3","ident_start":44242,"ident_end":44262,"extent_start":44236,"extent_end":44352,"ident_utf16":{"start":{"line_number":885,"utf16_col":6},"end":{"line_number":885,"utf16_col":26}},"extent_utf16":{"start":{"line_number":885,"utf16_col":0},"end":{"line_number":891,"utf16_col":0}}},{"name":"Stable Diffusion XL","fully_qualified_name":"Stable Diffusion XL","kind":"section_3","ident_start":44358,"ident_end":44377,"extent_start":44352,"extent_end":44472,"ident_utf16":{"start":{"line_number":891,"utf16_col":6},"end":{"line_number":891,"utf16_col":25}},"extent_utf16":{"start":{"line_number":891,"utf16_col":0},"end":{"line_number":897,"utf16_col":0}}},{"name":"Getting Started: Multihost development","fully_qualified_name":"Getting Started: Multihost development","kind":"section_2","ident_start":44475,"ident_end":44513,"extent_start":44472,"extent_end":45136,"ident_utf16":{"start":{"line_number":897,"utf16_col":3},"end":{"line_number":897,"utf16_col":41}},"extent_utf16":{"start":{"line_number":897,"utf16_col":0},"end":{"line_number":913,"utf16_col":0}}},{"name":"Comparison to Alternatives","fully_qualified_name":"Comparison to Alternatives","kind":"section_1","ident_start":45138,"ident_end":45164,"extent_start":45136,"extent_end":45464,"ident_utf16":{"start":{"line_number":913,"utf16_col":2},"end":{"line_number":913,"utf16_col":28}},"extent_utf16":{"start":{"line_number":913,"utf16_col":0},"end":{"line_number":917,"utf16_col":0}}},{"name":"Development","fully_qualified_name":"Development","kind":"section_1","ident_start":45466,"ident_end":45477,"extent_start":45464,"extent_end":47293,"ident_utf16":{"start":{"line_number":917,"utf16_col":2},"end":{"line_number":917,"utf16_col":13}},"extent_utf16":{"start":{"line_number":917,"utf16_col":0},"end":{"line_number":969,"utf16_col":0}}},{"name":"Pre-commit Hooks","fully_qualified_name":"Pre-commit Hooks","kind":"section_3","ident_start":45726,"ident_end":45742,"extent_start":45722,"extent_end":46587,"ident_utf16":{"start":{"line_number":926,"utf16_col":4},"end":{"line_number":926,"utf16_col":20}},"extent_utf16":{"start":{"line_number":926,"utf16_col":0},"end":{"line_number":951,"utf16_col":0}}},{"name":"Code Style","fully_qualified_name":"Code Style","kind":"section_3","ident_start":46591,"ident_end":46601,"extent_start":46587,"extent_end":47018,"ident_utf16":{"start":{"line_number":951,"utf16_col":4},"end":{"line_number":951,"utf16_col":14}},"extent_utf16":{"start":{"line_number":951,"utf16_col":0},"end":{"line_number":964,"utf16_col":0}}},{"name":"Profiling","fully_qualified_name":"Profiling","kind":"section_2","ident_start":47021,"ident_end":47030,"extent_start":47018,"extent_end":47163,"ident_utf16":{"start":{"line_number":964,"utf16_col":3},"end":{"line_number":964,"utf16_col":12}},"extent_utf16":{"start":{"line_number":964,"utf16_col":0},"end":{"line_number":967,"utf16_col":0}}},{"name":"Metrics","fully_qualified_name":"Metrics","kind":"section_2","ident_start":47166,"ident_end":47173,"extent_start":47163,"extent_end":47293,"ident_utf16":{"start":{"line_number":967,"utf16_col":3},"end":{"line_number":967,"utf16_col":10}},"extent_utf16":{"start":{"line_number":967,"utf16_col":0},"end":{"line_number":969,"utf16_col":0}}}]}},"codeViewLayoutRoute":{"repo":{"id":693349437,"defaultBranch":"main","name":"maxdiffusion","ownerLogin":"AI-Hypercomputer","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-09-18T21:16:15.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/181000646?v=4","public":true,"private":false,"isOrgOwned":true,"isArchived":false},"currentUser":null,"uploadToken":"q6bT9HlgzdIVqgT-cNrxMBwco7xYgIX_8vuaKIH5WOy_4NWhs3vBs9fWLCvqlj-FoSQ5Vp4ggTElATWRNw61FQ","allShortcutsEnabled":false,"treeExpanded":true,"path":"README.md","symbolsExpanded":false,"refInfo":{"name":"main","listCacheKey":"v0:1789470009.0","canEdit":false,"currentOid":"a4ff3aec6229821e4fdc61562ba1b647ac7e5061"},"helpUrl":"https://docs.github.com","githubDevUrl":null},"codeViewFileTreeLayoutRoute":{"fileTree":{"":{"items":[{"name":".gemini","path":".gemini","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":"dependencies","path":"dependencies","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"end_to_end","path":"end_to_end","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"utils","path":"utils","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"_typos.toml","path":"_typos.toml","contentType":"file"},{"name":"code_style.sh","path":"code_style.sh","contentType":"file"},{"name":"docker_build_dependency_image.sh","path":"docker_build_dependency_image.sh","contentType":"file"},{"name":"docker_upload_runner.sh","path":"docker_upload_runner.sh","contentType":"file"},{"name":"gpu_multi_process_run.sh","path":"gpu_multi_process_run.sh","contentType":"file"},{"name":"maxdiffusion_dependencies.Dockerfile","path":"maxdiffusion_dependencies.Dockerfile","contentType":"file"},{"name":"maxdiffusion_gpu_dependencies.Dockerfile","path":"maxdiffusion_gpu_dependencies.Dockerfile","contentType":"file"},{"name":"maxdiffusion_runner.Dockerfile","path":"maxdiffusion_runner.Dockerfile","contentType":"file"},{"name":"pylintrc","path":"pylintrc","contentType":"file"},{"name":"pyproject.toml","path":"pyproject.toml","contentType":"file"},{"name":"setup.sh","path":"setup.sh","contentType":"file"},{"name":"setup_gcsfuse.sh","path":"setup_gcsfuse.sh","contentType":"file"},{"name":"test_lightning.png","path":"test_lightning.png","contentType":"file"},{"name":"unit_test_and_lint.sh","path":"unit_test_and_lint.sh","contentType":"file"},{"name":"uv.toml","path":"uv.toml","contentType":"file"}],"totalCount":28}},"fileTreeProcessingTime":18.329974,"foldersToFetch":[]},"codeViewBlobLayoutRoute":{"codeLineWrapEnabled":false,"refInfo":{"name":"main","listCacheKey":"v0:1789470009.0","canEdit":false,"refType":"branch","currentOid":"a4ff3aec6229821e4fdc61562ba1b647ac7e5061","canEditOnDefaultBranch":false,"fileExistsOnDefault":true},"path":"README.md","blob":{"copilotSWEAgentEnabled":false,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/AI-Hypercomputer/maxdiffusion/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/AI-Hypercomputer/maxdiffusion/blob/main/README.md?raw=true","headerInfo":{"blobSize":"46.2 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"4d20883","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FAI-Hypercomputer%2Fmaxdiffusion%2Fblob%2Fmain%2FREADME.md","isCSV":false,"isRichtext":true,"lineInfo":{"truncatedLoc":"969","truncatedSloc":"750"},"mode":"executable file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"isIssueTemplate":false,"isDiscussionTemplate":false,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/AI-Hypercomputer/maxdiffusion/blob/main/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/AI-Hypercomputer/maxdiffusion/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/AI-Hypercomputer/maxdiffusion/raw/refs/heads/main/README.md","renderImageOrRaw":false,"shortPath":null,"symbolsEnabled":true,"tabSize":4,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null},"copilotInfo":null,"copilotAccessAllowed":false,"copilotSpacesEnabled":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"isMarketplaceEnabled":true},"codeViewBlobLayoutRoute.StyledBlob":{"rawLines":["\u003c!--"," Copyright 2024 Google LLC",""," Licensed under the Apache License, Version 2.0 (the \"License\");"," you may not use this file except in compliance with the License."," You may obtain a copy of the License at","","      https://www.apache.org/licenses/LICENSE-2.0",""," Unless required by applicable law or agreed to in writing, software"," distributed under the License is distributed on an \"AS IS\" BASIS,"," WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."," See the License for the specific language governing permissions and"," limitations under the License."," --\u003e","","[![Unit Tests](https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml/badge.svg)](https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml)","","# What's new?","- **`2026/08/28`**: Flux2.Klein text to image and image editing (w/ KV Cache) is now supported.","- **`2026/07/14`**: Automatic attention tile-size (`block_q`/`block_kv`) search for Wan is now supported.","- **`2026/06/26`**: 2D ring (USP) attention with a custom splash kernel is now supported for Wan (`ulysses_ring_custom`), splitting context parallelism into an intra-chip Ulysses axis and a cross-chip ring axis.","- **`2026/04/16`**: Support for Tokamax Ring Attention kernel is now added.","- **`2026/03/31`**: Wan2.2 SenCache inference is now supported for T2V and I2V (up to 1.4x speedup)","- **`2026/03/25`**: Wan2.1 and Wan2.2 Magcache inference is now supported","- **`2026/03/25`**: LTX-2 Video Inference is now supported","- **`2026/01/29`**: Wan LoRA for inference is now supported","- **`2026/01/15`**: Wan2.1 and Wan2.2 Img2vid generation is now supported","- **`2025/11/11`**: Wan2.2 txt2vid generation is now supported","- **`2025/10/10`**: Wan2.1 txt2vid training and generation is now supported.","- **`2025/10/14`**: NVIDIA DGX Spark Flux support.","- **`2025/08/14`**: LTX-Video img2vid generation is now supported.","- **`2025/07/29`**: LTX-Video text2vid generation is now supported.","- **`2025/04/17`**: Flux Finetuning.","- **`2025/02/12`**: Flux LoRA for inference.","- **`2025/02/08`**: Flux schnell \u0026 dev inference.","- **`2024/12/12`**: Load multiple LoRAs for inference.","- **`2024/10/22`**: LoRA support for Hyper SDXL.","- **`2024/08/01`**: Orbax is the new default checkpointer. You can still use `pipeline.save_pretrained` after training to save in diffusers format.","- **`2024/07/20`**: Dreambooth training for Stable Diffusion 1.x,2.x is now supported.","","# Overview","","MaxDiffusion is a collection of reference implementations of various latent diffusion models written in pure Python/Jax that run on XLA devices including Cloud TPUs and GPUs. MaxDiffusion aims to be a launching off point for ambitious Diffusion projects both in research and production. We encourage you to start by experimenting with MaxDiffusion out of the box and then fork and modify MaxDiffusion to meet your needs.","","The goal of this project is to provide reference implementations for latent diffusion models that help developers get started with training, tuning, and serving solutions on XLA devices including Cloud TPUs and GPUs. We started with Stable Diffusion inference on TPUs, but welcome code contributions to grow.","","MaxDiffusion supports","* Stable Diffusion 2 base (inference)","* Stable Diffusion 2.1 (training and inference)","* Stable Diffusion XL (training and inference).","* Flux Dev and Schnell (Training and inference).","* Flux.2-Klein 4B \u0026 9B (text-to-image and multi-image editing with KV-Cache).","* Stable Diffusion Lightning (inference).","* Hyper-SD XL LoRA loading (inference).","* Load Multiple LoRA (SDXL inference).","* ControlNet inference (Stable Diffusion 1.4 \u0026 SDXL).","* Dreambooth training support for Stable Diffusion 1.x,2.x.","* LTX-Video text2vid, img2vid (inference).","* LTX-2 Video text2vid (inference).","* Wan2.1 text2vid (training and inference).","* Wan2.2 text2vid (inference).","","**Note on GPU Support:** GPU support is not actively maintained, but contributions are welcome","","","# Table of Contents","","- [What's new?](#whats-new)","- [Overview](#overview)","- [Table of Contents](#table-of-contents)","- [Getting Started](#getting-started)","  - [Getting Started:](#getting-started-1)","  - [NVIDIA DGX Spark](#nvidia-dgx-spark)","  - [Training](#training)","    - [Wan2.1](#wan-21-training)","    - [Flux](#flux-training)","    - [SDXL](#stable-diffusion-xl-training)","    - [SD 2 base](#stable-diffusion-2-base-training)","    - [SD 1.4](#stable-diffusion-14-training)","    - [Dreambooth](#dreambooth)","  - [Inference](#inference)","    - [Wan](#wan-models)","    - [LTX-Video](#ltx-video)","    - [LTX-2 Video](#ltx-2-video)","    - [Flux](#flux)","      - [Fused Attention for GPU](#fused-attention-for-gpu)","    - [SDXL](#stable-diffusion-xl)","    - [SD 2 base](#stable-diffusion-2-base)","    - [SD 2.1](#stable-diffusion-21)","    - [Wan LoRA](#wan-lora)","    - [Flux LoRA](#flux-lora)","    - [Hyper SDXL LoRA](#hyper-sdxl-lora)","    - [Load Multiple LoRA](#load-multiple-lora)","    - [SDXL Lightning](#sdxl-lightning)","    - [ControlNet](#controlnet)","  - [Getting Started: Multihost development](#getting-started-multihost-development)","- [Comparison to Alternatives](#comparison-to-alternatives)","- [Development](#development)","  - [Profiling](#profiling)","  - [Metrics](#metrics)","","# Getting Started","","We recommend starting with a single TPU host and then moving to multihost.","","Minimum requirements: Ubuntu Version 22.04, Python 3.12 and Tensorflow \u003e= 2.12.0.","","## Getting Started:","","For your first time running Maxdiffusion, we provide specific [instructions](docs/getting_started/first_run.md).","","## NVIDIA DGX Spark","","Try out MaxDiffusion on NVIDIA's DGX Spark. We provide specific [instructions](docs/dgx_spark.md).","","## Training","","After installation completes, run the training script.","","  ## Wan 2.1 Training","","  in the first part, we'll run on a single host VM to get familiar with the workflow, then run on xpk for large scale training.","","  Although not required, attaching an external disk is recommended as weights take up a lot of disk space. [Follow these instructions if you would like to attach an external disk](https://cloud.google.com/tpu/docs/attach-durable-block-storage).","","  This workflow was tested using v5p-8 with a 500GB disk attached.","","  ### Dataset Preparation","","  For this example, we'll be using the [PusaV1 dataset](https://huggingface.co/datasets/RaphaelLiu/PusaV1_training).","","  First, download the dataset.","","  ```bash","  export HF_DATASET_DIR=/mnt/disks/external_disk/PusaV1_training/","  export TFRECORDS_DATASET_DIR=/mnt/disks/external_disk/wan_tfr_dataset_pusa_v1","  huggingface-cli download RaphaelLiu/PusaV1_training --repo-type dataset --local-dir $HF_DATASET_DIR","  ```","","  Next run the TFRecords conversion script. This step prepares training and eval datasets. Validation is done as described in  [Scaling Rectified Flow Transformers for High-Resolution Image Synthesis](https://arxiv.org/pdf/2403.03206). More details [here](https://github.com/mlcommons/training/tree/master/text_to_image#5-quality)","","  Training dataset.","","  ```bash","  python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/train no_records_per_shard=10 enable_eval_timesteps=False","  ```","","  The script will not have an output, but you can check the progress using:","","  ```bash","  ls -ll $TFRECORDS_DATASET_DIR/train","  ```","","  Evaluation dataset.","","  ```bash","  python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/eval no_records_per_shard=10 enable_eval_timesteps=True","  ```","","  The evaluation dataset creation takes the first 420 samples of the dataset and adds a timestep field. We then need to manually delete the first 420 samples from the `train` folder so they are not used in training.","","","  ```bash","  printf \"%s\\n\" $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 \u003c= 420' | xargs -d '\\n' rm","  ```","","  And verify that they do not exist.","","  ```bash","  printf \"%s\\n\" $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 \u003c= 420' | xargs -d '\\n' echo","  ```","","  After the script is done running, you should see the following directory structure inside `$TFRECORDS_DATASET_DIR`","","  ```","  train","  eval_timesteps","  ```","","  In some instances an empty file `file_42-430.tfrec` is created inside `eval_timesteps`, for sanity check, let's run a delete command.","","  ```bash","  rm $TFRECORDS_DATASET_DIR/eval_timesteps/file_42-430.tfrec","  ```","","  ### Training on a Single VM","","  Loading the data is supported both locally from the disk created above, or from `gcs`. In this guide, we'll be using a gcs bucket to train. First copy the data to the GCS bucket.","","  ```bash","  BUCKET_NAME=my-bucket","  gcloud storage cp --recursive $TFRECORDS_DATASET_DIR gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}","  ```","","  Now run the training command:","","  ```bash","  RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}","  OUTPUT_DIR=gs://$BUCKET_NAME/wan/","  DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/","  EVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/","  SAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/","  ```","","  ```bash","  export LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\","  --xla_tpu_megacore_fusion_allow_ags=false \\","  --xla_enable_async_collective_permute=true \\","  --xla_tpu_enable_ag_backward_pipelining=true \\","  --xla_tpu_enable_data_parallel_all_reduce_opt=true \\","  --xla_tpu_data_parallel_opt_different_sized_ops=true \\","  --xla_tpu_enable_async_collective_fusion=true \\","  --xla_tpu_enable_async_collective_fusion_multiple_steps=true \\","  --xla_tpu_overlap_compute_collective_tc=true \\","  --xla_enable_async_all_gather=true \\","  --xla_tpu_scoped_vmem_limit_kib=65536 \\","  --xla_tpu_enable_async_all_to_all=true \\","  --xla_tpu_enable_all_experimental_scheduler_features=true \\","  --xla_tpu_enable_scheduler_memory_pressure_tracking=true \\","  --xla_tpu_host_transfer_overlap_limit=24 \\","  --xla_tpu_aggressive_opt_barrier_removal=ENABLED \\","  --xla_lhs_prioritize_async_depth_over_stall=ENABLED \\","  --xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\","  --xla_should_add_loop_invariant_op_in_chain=ENABLED \\","  --xla_max_concurrent_host_send_recv=100 \\","  --xla_tpu_scheduler_percent_shared_memory_limit=100 \\","  --xla_latency_hiding_scheduler_rerun=2 \\","  --xla_tpu_use_minor_sharding_for_major_trivial_input=true \\","  --xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\","  --xla_tpu_assign_all_reduce_scatter_layout=true'","  ```","","  ```bash","  HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \\","  src/maxdiffusion/configs/base_wan_14b.yml \\","  attention='flash' \\","  weights_dtype=bfloat16 \\","  activations_dtype=bfloat16 \\","  guidance_scale=5.0 \\","  flow_shift=5.0 \\","  fps=16 \\","  skip_jax_distributed_system=False \\","  run_name=${RUN_NAME} \\","  output_dir=${OUTPUT_DIR} \\","  train_data_dir=${DATASET_DIR} \\","  load_tfrecord_cached=True \\","  height=1280 \\","  width=720 \\","  num_frames=81 \\","  num_inference_steps=50 \\","  jax_cache_dir=${OUTPUT_DIR}/jax_cache/ \\","  max_train_steps=1000 \\","  enable_profiler=True \\","  dataset_save_location=${SAVE_DATASET_DIR} \\","  remat_policy='HIDDEN_STATE_WITH_OFFLOAD' \\","  flash_min_seq_length=0 \\","  seed=$RANDOM \\","  skip_first_n_steps_for_profiler=3 \\","  profiler_steps=3 \\","  per_device_batch_size=0.25 \\","  ici_data_parallelism=1 \\","  ici_fsdp_parallelism=4 \\","  ici_tensor_parallelism=1","  ```","","  It is important to note a couple of things:","  - per_device_batch_size can be a fractional, but must be a whole number when multiplied by number of devices. In this example, 0.25 * 4 (devices) = effective global batch size = 1.","  - The step time in v5p-8 with global batch size = 1 is large due to using `FULL` remat. On larger number of chips we can run larger batch sizes greatly increasing MFU, as we will see in the next session of deploying with xpk.","  - To enable eval during training set `eval_every` to a value \u003e 0.","  - In Wan2.1, the ici_fsdp_parallelism axis is used for sequence parallelism, the ici_tensor_parallelism axis is used for head parallelism.","    - You can enable both, keeping in mind that Wan2.1 has 40 heads and 40 must be evenly divisible by ici_tensor_parallelism.","    - For Sequence parallelism, the code pads the sequence length to evenly divide the sequence. Try out different ici_fsdp_parallelism numbers, but we find 2 and 4 to be the best right now.","  - For use on GPU it is recommended to enable the cudnn_te_flash attention kernel for optimal performance.","    - Best performance is achieved with the use of batch parallelism, which can be enabled by using the ici_fsdp_batch_parallelism axis. Note that this parallelism strategy does not support fractional batch sizes.","    - ici_fsdp_batch_parallelism and ici_fsdp_parallelism can be combined to allow for fractional batch sizes. However, padding is not currently supported for the cudnn_te_flash attention kernel and it is therefore required that the sequence length is divisible by the number of devices in the ici_fsdp_parallelism axis.","  - For benchmarking training performance on multiple data dimension input without downloading/re-processing the dataset, the synthetic data iterator is supported.","    - Set dataset_type='synthetic' and synthetic_num_samples=null to enable the synthetic data iterator.","    - The following overrides on data dimensions are supported:","      - synthetic_override_height: 720","      - synthetic_override_width: 1280","      - synthetic_override_num_frames: 85","      - synthetic_override_max_sequence_length: 512","      - synthetic_override_text_embed_dim: 4096","      - synthetic_override_num_channels_latents: 16","      - synthetic_override_vae_scale_factor_spatial: 8","      - synthetic_override_vae_scale_factor_temporal: 4","","  You should eventually see a training run as:","","  ```bash","  ***** Running training *****","  Instantaneous batch size per device = 0.25","  Total train batch size (w. parallel \u0026 distributed) = 1","  Total optimization steps = 1000","  Calculated TFLOPs per pass: 4893.2719","  Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4","  Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4","  Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4","  Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4","  completed step: 0, seconds: 142.395, TFLOP/s/device: 34.364, loss: 0.270","  To see full metrics 'tensorboard --logdir=gs://jfacevedo-maxdiffusion-v5p/wan/jfacevedo-wan-v5p-8-17263/tensorboard/'","  completed step: 1, seconds: 137.207, TFLOP/s/device: 35.664, loss: 0.144","  completed step: 2, seconds: 36.014, TFLOP/s/device: 135.871, loss: 0.210","  completed step: 3, seconds: 36.016, TFLOP/s/device: 135.864, loss: 0.120","  completed step: 4, seconds: 36.008, TFLOP/s/device: 135.894, loss: 0.107","  completed step: 5, seconds: 36.008, TFLOP/s/device: 135.895, loss: 0.346","  completed step: 6, seconds: 36.006, TFLOP/s/device: 135.900, loss: 0.169","  ```","","  ### Deploying with XPK","","  This assumes the user has already created an xpk cluster, installed all dependencies and the also created the dataset from the step above. For getting started with MaxDiffusion and xpk see [this guide](docs/getting_started/run_maxdiffusion_via_xpk.md).","","  Using v5p-256 Then the command to run on xpk is as follows:","","  ```bash","  RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}","  OUTPUT_DIR=gs://$BUCKET_NAME/wan/","  DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/","  EVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/","  SAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/","  ```","","  ```bash","  LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \\","  --xla_tpu_megacore_fusion_allow_ags=false \\","  --xla_enable_async_collective_permute=true \\","  --xla_tpu_enable_ag_backward_pipelining=true \\","  --xla_tpu_enable_data_parallel_all_reduce_opt=true \\","  --xla_tpu_data_parallel_opt_different_sized_ops=true \\","  --xla_tpu_enable_async_collective_fusion=true \\","  --xla_tpu_enable_async_collective_fusion_multiple_steps=true \\","  --xla_tpu_overlap_compute_collective_tc=true \\","  --xla_enable_async_all_gather=true \\","  --xla_tpu_scoped_vmem_limit_kib=65536 \\","  --xla_tpu_enable_async_all_to_all=true \\","  --xla_tpu_enable_all_experimental_scheduler_features=true \\","  --xla_tpu_enable_scheduler_memory_pressure_tracking=true \\","  --xla_tpu_host_transfer_overlap_limit=24 \\","  --xla_tpu_aggressive_opt_barrier_removal=ENABLED \\","  --xla_lhs_prioritize_async_depth_over_stall=ENABLED \\","  --xla_should_allow_loop_variant_parameter_in_chain=ENABLED \\","  --xla_should_add_loop_invariant_op_in_chain=ENABLED \\","  --xla_max_concurrent_host_send_recv=100 \\","  --xla_tpu_scheduler_percent_shared_memory_limit=100 \\","  --xla_latency_hiding_scheduler_rerun=2 \\","  --xla_tpu_use_minor_sharding_for_major_trivial_input=true \\","  --xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \\","  --xla_tpu_assign_all_reduce_scatter_layout=true'","  ```","","  ```bash","  python3 ~/xpk/xpk.py workload create \\","  --cluster=$CLUSTER_NAME \\","  --project=$PROJECT \\","  --zone=$ZONE \\","  --device-type=$DEVICE_TYPE \\","  --num-slices=1 \\","  --command=\" \\","  HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \\","  src/maxdiffusion/configs/base_wan_14b.yml \\","  attention='flash' \\","  weights_dtype=bfloat16 \\","  activations_dtype=bfloat16 \\","  guidance_scale=5.0 \\","  flow_shift=5.0 \\","  fps=16 \\","  skip_jax_distributed_system=False \\","  run_name=${RUN_NAME} \\","  output_dir=${OUTPUT_DIR} \\","  train_data_dir=${DATASET_DIR} \\","  load_tfrecord_cached=True \\","  height=1280 \\","  width=720 \\","  num_frames=81 \\","  num_inference_steps=50 \\","  jax_cache_dir=${OUTPUT_DIR}/jax_cache/ \\","  enable_profiler=True \\","  dataset_save_location=${SAVE_DATASET_DIR} \\","  remat_policy='HIDDEN_STATE_WITH_OFFLOAD' \\","  flash_min_seq_length=0 \\","  seed=$RANDOM \\","  skip_first_n_steps_for_profiler=3 \\","  profiler_steps=3 \\","  per_device_batch_size=0.25 \\","  ici_data_parallelism=32 \\","  ici_fsdp_parallelism=4 \\","  ici_tensor_parallelism=1 \\","  max_train_steps=5000 \\","  eval_every=100 \\","  eval_data_dir=${EVAL_DATA_DIR} \\","  enable_generate_video_for_eval=True\" \\","  --base-docker-image=${IMAGE_DIR} \\","  --enable-debug-logs \\","  --workload=${RUN_NAME} \\","  --priority=medium \\","  --max-restarts=0","  ```","","  ## Flux Training","","  Expected results on 1024 x 1024 images with flash attention and bfloat16:","","  | Model | Accelerator | Sharding Strategy | Per Device Batch Size | Global Batch Size | Step Time (secs) |","  | --- | --- | --- | --- | --- | --- |","  | Flux-dev | v5p-8 | FSDP | 2 | 8 | 1.769 |","","  Flux finetuning has only been tested on TPU v5p.","","  To run the Flux training benchmark on v5p-8, use:","","  ```bash","  python src/maxdiffusion/train_flux.py src/maxdiffusion/configs/base_flux_dev.yml \\","      run_name=\"flux-training\" \\","      output_dir=\"gs://\u003cyour-gcs-bucket\u003e/\" \\","      jax_cache_dir=\"/tmp/jax_cache\" \\","      save_final_checkpoint=False \\","      max_train_steps=100 \\","      dataset_type=synthetic \\","      ici_data_parallelism=1 \\","      ici_fsdp_parallelism=4 \\","      ici_tensor_parallelism=1 \\","      train_new_flux=True \\","      resolution=1024 \\","      attention_sharding_uniform=False \\","      attention=tokamax_flash \\","      per_device_batch_size=2 \\","      enable_profiler=False \\","      reuse_example_batch=True \\","      write_metrics=False \\","      use_base2_exp=True","  ```","","  To generate images with a finetuned checkpoint, run:","","  ```bash","  python src/maxdiffusion/generate_flux_pipeline.py src/maxdiffusion/configs/base_flux_dev.yml  run_name=\"test-flux-train\" output_dir=\"gs://\u003cyour-gcs-bucket\u003e/\" jax_cache_dir=\"/tmp/jax_cache\"","  ```","","  ## Stable Diffusion XL Training","","  ```bash","  export LIBTPU_INIT_ARGS=\"\"","  python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\"my_xl_run\" output_dir=\"gs://your-bucket/\" per_device_batch_size=1","  ```","","  On GPUS with Fused Attention:","","  First install Transformer Engine by following the [instructions here](#fused-attention-for-gpu).","","  ```bash","  NVTE_FUSED_ATTN=1 python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml hardware=gpu run_name='test-sdxl-train' output_dir=/tmp/ train_new_unet=true train_text_encoder=false cache_latents_text_encoder_outputs=true max_train_steps=200 weights_dtype=bfloat16 resolution=512 per_device_batch_size=1 attention=\"cudnn_flash_te\" jit_initializers=False","  ```","","  To generate images with a trained checkpoint, run:","","  ```bash","  python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_xl.yml run_name=\"my_run\" pretrained_model_name_or_path=\u003cyour_saved_checkpoint_path\u003e from_pt=False attention=dot_product","  ```","","  ## Stable Diffusion 2 base Training","","  ```bash","  export LIBTPU_INIT_ARGS=\"\"","  python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=\"my_run\" jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash","  ```","","  ## Stable Diffusion 1.4 Training","","  ```bash","  export LIBTPU_INIT_ARGS=\"\"","  python -m src.maxdiffusion.train src/maxdiffusion/configs/base14.yml run_name=\"my_run\" jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash","  ```","","  To generate images with a trained checkpoint, run:","","  ```bash","  python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\"my_run\" output_dir=gs://your-bucket/ from_pt=False attention=dot_product","  ```","","  ## Dreambooth","","  Supported models are **Stable Diffusion 1.x,2.x**","","  ```bash","  python src/maxdiffusion/dreambooth/train_dreambooth.py src/maxdiffusion/configs/base14.yml class_data_dir=\u003cyour-class-dir\u003e instance_data_dir=\u003cyour-instance-dir\u003e instance_prompt=\"a photo of ohwx dog\" class_prompt=\"photo of a dog\" max_train_steps=150 jax_cache_dir=\u003cyour-cache-dir\u003e class_prompt=\"a photo of a dog\" activations_dtype=bfloat16 weights_dtype=float32 per_device_batch_size=1 enable_profiler=False precision=DEFAULT cache_dreambooth_dataset=False learning_rate=4e-6 num_class_images=100 run_name=\u003cyour-run-name\u003e output_dir=gs://\u003cyour-bucket-name\u003e","  ```","","## Inference","","To generate images, run the following command:","  ## Stable Diffusion XL","","  Single and Multi host inference is supported with sharding annotations:","","  ```bash","  python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl.yml run_name=\"my_run\"","  ```","","  Single host pmap version:","","  ```bash","  python -m src.maxdiffusion.generate_sdxl_replicated","  ```","","  ## Stable Diffusion 2 base","  ```bash","  python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=\"my_run\"","  ```","","  ## Stable Diffusion 2.1","  ```bash","  python -m src.maxdiffusion.generate src/maxdiffusion/configs/base21.yml run_name=\"my_run\"","  ```","","  ## LTX-Video","  In the folder src/maxdiffusion/models/ltx_video/utils, run:","","  ```bash","  python convert_torch_weights_to_jax.py --ckpt_path [LOCAL DIRECTORY FOR WEIGHTS] --transformer_config_path ../ltxv-13B.json","  ```","","  In the repo folder, run:","  ```bash","  python src/maxdiffusion/generate_ltx_video.py src/maxdiffusion/configs/ltx_video.yml output_dir=\"[SAME DIRECTORY]\" config_path=\"src/maxdiffusion/models/ltx_video/ltxv-13B.json\"","  ```","  Img2video Generation:","","  Add conditioning image path as conditioning_media_paths in the form of [\"IMAGE_PATH\"] along with other generation parameters in the ltx_video.yml file. Then follow same instruction as above.","","  ## LTX-2 Video","","  Although not required, attaching an external disk is recommended as weights take up a lot of disk space. [Follow these instructions if you would like to attach an external disk](https://cloud.google.com/tpu/docs/attach-durable-block-storage).","","  The following command will run LTX-2 T2V:","","   ```bash","  HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\","  LIBTPU_INIT_ARGS=\"--xla_tpu_enable_async_collective_fusion=true \\","  --xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\","  --xla_tpu_enable_async_collective_fusion_multiple_steps=true \\","  --xla_tpu_overlap_compute_collective_tc=true \\","  --xla_enable_async_all_reduce=true\" \\","  HF_HUB_ENABLE_HF_TRANSFER=1 \\","  python src/maxdiffusion/generate_ltx2.py \\","  src/maxdiffusion/configs/ltx2_video.yml \\","  attention=\"flash\" \\","  num_inference_steps=40 \\","  num_frames=121 \\","  width=768 \\","  height=512 \\","  per_device_batch_size=.125 \\","  ici_data_parallelism=2 \\","  ici_context_parallelism=4 \\","  run_name=ltx2-inference","  ```","","  ## Wan Models","","  Although not required, attaching an external disk is recommended as weights take up a lot of disk space. [Follow these instructions if you would like to attach an external disk](https://cloud.google.com/tpu/docs/attach-durable-block-storage).","","  Supports both Text2Vid and Img2Vid pipelines.","","  **Note**: The product of per_device_batch_size and num_devices must be equal to a whole number.","","  The below command uses 4 devices and a per_device_batch_size=0.25. Thus, 4 * 0.25 = 1. This will generate a single video. Setting per_device_batch_size to 0.5, will generate 2 videos and so on.","","  If using 8 devices, then per_device_batch_size=0.125 will generate 1 video, per_device_batch_size=0.25 generates 2 videos.","","  The following command will run Wan2.1 T2V:","","  ```bash","  HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\","  LIBTPU_INIT_ARGS=\"--xla_tpu_enable_async_collective_fusion=true \\","  --xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\","  --xla_tpu_enable_async_collective_fusion_multiple_steps=true \\","  --xla_tpu_overlap_compute_collective_tc=true \\","  --xla_enable_async_all_reduce=true\" \\","  HF_HUB_ENABLE_HF_TRANSFER=1 \\","  python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_14b.yml \\","  attention=\"flash\" \\","  num_inference_steps=50 \\","  num_frames=81 \\","  width=1280 \\","  height=720 \\","  jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\","  per_device_batch_size=.0.25 \\","  ici_data_parallelism=2 \\","  ici_context_parallelism=2 \\","  flow_shift=5.0 \\","  enable_profiler=True \\","  run_name=wan-inference-testing-720p \\","  output_dir=gs:/jfacevedo-maxdiffusion \\","  fps=16 \\","  flash_min_seq_length=0 \\","  flash_block_sizes='{\"block_q\" : 3024, \"block_kv_compute\" : 1024, \"block_kv\" : 2048, \"block_q_dkv\": 3024, \"block_kv_dkv\" : 2048, \"block_kv_dkv_compute\" : 2048, \"block_q_dq\" : 3024, \"block_kv_dq\" : 2048 }' \\","  seed=118445","  ```","","  To run other Wan model inference pipelines, change the config file in the command above:","","  * For Wan2.1 I2V, use `base_wan_i2v_14b.yml`.","  * For Wan2.2 T2V, use `base_wan_27b.yml`.","  * For Wan2.2 I2V, use `base_wan_i2v_27b.yml`.","","  ### Ulysses Attention","","  MaxDiffusion supports Ulysses attention for WAN TPU inference. Enable it by setting `attention=\"ulysses\"`.","","  Internally, this follows the Ulysses sequence-parallel attention pattern and trades sequence shards for head shards around the local TPU splash kernel. For background, see [DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models](https://arxiv.org/abs/2309.14509).","","  To enable Ulysses attention, set the corresponding override in your config YAML or pass it as a command-line override:","","  ```bash","  python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_i2v_27b.yml \\","  attention=\"ulysses\" \\","  ici_context_parallelism=4 \\","  ...","  ```","","  Ulysses requires `ici_context_parallelism` greater than 1, and the number of attention heads must be divisible by the context shard count. `flash_block_sizes` tuning is optional and can still be used for hardware-specific tuning.","","  In our Wan2.2 I2V benchmarks at 40 inference steps, 81 frames, and `720x1280` resolution, Ulysses improved inference time by roughly `~10%` compared with flash attention, with about `~20s` lower latency on the v6e-8 and v7x-8 TPU setup.","","  #### Chunked Ulysses Attention (Overlapping Communication and Compute)","","  If you observe a major `all-to-all` communication bottleneck (especially when communication overhead is more pronounced compared to attention computation), you can enable **Chunked Ulysses Attention**.","","  By setting `ulysses_attention_chunks` greater than 1, MaxDiffusion splits the Ulysses all-to-all communication and attention computation into head-group passes (chunks). This allows XLA to overlap the all-to-all communication of one chunk with the head-parallel local attention compute of another chunk, significantly mitigating the communication bottleneck.","","  This chunking technique is supported and works for both plain Ulysses attention (`attention=\"ulysses\"`) and hybrid Ulysses+Ring 2D attention/context parallelism (`attention=\"ulysses_ring\"`).","","  To enable chunked Ulysses attention, set the corresponding override (e.g. `ulysses_attention_chunks=2` or `ulysses_attention_chunks=5`) in your config YAML or command line:","","  ```bash","  python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_i2v_27b.yml \\","  attention=\"ulysses\" \\","  ici_context_parallelism=4 \\","  ulysses_attention_chunks=2 \\","  ...","  ```","","  \u003e [!IMPORTANT]","  \u003e For communication-compute overlap to be effective on TPUs, you must enable the following XLA flags before running:","  \u003e ```bash","  \u003e export XLA_FLAGS=\"--xla_tpu_enable_async_all_to_all=true --xla_tpu_overlap_compute_collective_tc=true\"","  \u003e ```","","  ### Caching Mechanisms","","  Wan 2.x pipelines support several caching strategies to accelerate inference by skipping redundant transformer forward passes. These are **mutually exclusive** — enable only one at a time.","","  | Cache Type | Config Flag | Supported Pipelines | Speedup | Description |","  | --- | --- | --- | --- | --- |","  | **CFG Cache** | `use_cfg_cache: True` | Wan 2.1 T2V, Wan 2.2 T2V/I2V | ~1.2x | FasterCache-style: caches the unconditional branch and applies FFT frequency-domain compensation on skipped steps. |","  | **SenCache** | `use_sen_cache: True` | Wan 2.2 T2V/I2V | ~1.4x | Sensitivity-Aware Caching ([arXiv:2602.24208](https://arxiv.org/abs/2602.24208)): predicts output change via first-order sensitivity S = α_x·‖Δx‖ + α_t·\\|Δt\\|. Skips the full CFG forward pass when predicted change is below tolerance ε. |","  | **MagCache** | `use_magcache: True` | Wan 2.1 T2V, Wan 2.2 T2V/I2V | ~1.75–1.9x | [MagCache](https://github.com/Zehong-Ma/MagCache): skips the transformer blocks and reuses the cached block residual when the accumulated magnitude-ratio error stays below `magcache_thresh`, capped at `magcache_K` consecutive skips. Uses a precalibrated per-step `mag_ratios_base` curve, so the skip schedule is deterministic (no data-dependent control flow). |","","  For Wan 2.2 (dual-transformer), MagCache uses a single `mag_ratios_base` curve across both phases, forces a full recompute for the first `retention_ratio` fraction of each phase, and resets the cached residual at the high→low boundary. The shipped curves are seeded from the official Wan2.2 values (`base_wan_27b.yml` for T2V, `base_wan_i2v_27b.yml` for I2V); recalibrate for your dtype/attention kernel to tighten the quality gap.","","  \u003e **Wan 2.2 T2V requires `flow_shift=12.0`** — it sets where the high→low boundary lands, which is what `mag_ratios_base` is calibrated against. A lower shift (e.g. `5.0`) moves the boundary out of phase, so MagCache skips at the wrong steps and quality drops.","","  Benchmarks (7x, A14B, 720×1280, 81 frames, 40 steps, vs dense — SSIM/PSNR largely reflect trajectory divergence, not visible degradation):","","  | Variant | Settings | Speedup | SSIM / PSNR |","  | --- | --- | --- | --- |","  | T2V | `flow_shift=12.0`, `magcache_thresh=0.04`, `magcache_K=2` | ~1.82× (18/40 skipped) | 0.72 / 21.8 dB |","  | I2V | `flow_shift=5.0`, `boundary_ratio=0.900`, `magcache_thresh=0.06`, `magcache_K=2` | ~1.75× (17/40 skipped) | 0.91 / 25.4 dB |","","  To enable a caching mechanism, set the corresponding flag in your config YAML or pass it as a command-line override:","","  ```bash","  # Example: enable SenCache for Wan 2.2 T2V","  python src/maxdiffusion/generate_wan.py \\","    src/maxdiffusion/configs/base_wan_27b.yml \\","    use_sen_cache=True \\","    ...","","  # Example: enable CFG Cache for Wan 2.2 I2V","  python src/maxdiffusion/generate_wan.py \\","    src/maxdiffusion/configs/base_wan_i2v_27b.yml \\","    use_cfg_cache=True \\","    ...","","# Example: enable MagCache for Wan 2.2 T2V","python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_27b.yml \\","  use_magcache=True \\","  magcache_thresh=0.04 \\","  magcache_K=2 \\","  ...","","# Example: enable MagCache for Wan 2.2 I2V","python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_i2v_27b.yml \\","  use_magcache=True \\","  magcache_thresh=0.06 \\","  magcache_K=2 \\","  ...","```","","### Ring Attention","We added ring attention support for Wan models. Below are the stats for one `720p` (81 frames) video generation (with CFG DP):","| Accelerator |  Model | Attention Type | Inference Steps | Sharding | e2e Generation Time |","| -- | -- | -- | -- | -- | -- |","| v7x-8 | WAN 2.1 | Tokamax Flash | 50 | dp2-fsdp1-context4-tp1 | **249.3** |","| v7x-8 | WAN 2.1 | Tokamax Ring | 50 | dp2-fsdp1-context4-tp1 | 252.4 |","| v7x-8 | WAN 2.2 | Tokamax Flash | 40 | dp2-fsdp1-context4-tp1 | **194.4** |","| v7x-8 | WAN 2.2 | Tokamax Ring | 40 | dp2-fsdp1-context4-tp1 | 201.7 |","","| Accelerator |  Model | Attention Type | Inference Steps | Sharding | e2e Generation Time |","| -- | -- | -- | -- | -- | -- |","| v7x-16 | WAN 2.1 | Tokamax Flash | 50 | dp2-fsdp1-context8-tp1 | **127.1** |","| v7x-16 | WAN 2.1 | Tokamax Ring | 50 | dp2-fsdp1-context8-tp1 | 137.2 |","| v7x-16 | WAN 2.2 | Tokamax Flash | 40 | dp2-fsdp1-context8-tp1 | **106.0** |","| v7x-16 | WAN 2.2 | Tokamax Ring | 40 | dp2-fsdp1-context8-tp1 | 137.5 |","","(* There are some known stability issues for ring attention on 16 TPUs, please use `tokamax_flash` attention instead.)","","### Automatic Tile-Size Search","","The optimal attention tile sizes (`block_q` / `block_kv`) depend on the sequence length, VMEM, sharding, and accelerator, and the feasibility edge is a VMEM OOM with no clean closed form — so we tune them empirically. Passing `enable_tile_search=true` to `generate_wan.py` runs a fast one-DiT-block grid search before inference and injects the winning block sizes into `flash_block_sizes` (`tile_search_mode=smart` by default; the search is opt-in and off by default).  The core is model-agnostic (`utils/tile_size_grid_search.py`) with a per-model plug (`utils/wan_block_benchmark.py`), which also runs standalone via `python -m maxdiffusion.utils.wan_block_benchmark ... --smart-search`.","","  ## Flux","","  First make sure you have permissions to access the Flux repos in Huggingface.","","  Expected results on 1024 x 1024 images with flash attention and bfloat16:","","  | Model | Accelerator | Sharding Strategy | Batch Size | Steps | time (secs) |","  | --- | --- | --- | --- | --- | --- |","  | Flux-dev | v4-8 | DDP | 4 | 28 | 23 |","  | Flux-schnell | v4-8 | DDP | 4 | 4 | 2.2 |","  | Flux-dev | v6e-4 | DDP | 4 | 28 | 5.5 |","  | Flux-schnell | v6e-4 | DDP | 4 | 4 | 0.8 |","  | Flux-schnell | v6e-4 | FSDP | 4 | 4 | 1.2 |","","  Schnell:","","  ```bash","  python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\"photograph of an electronics chip in the shape of a race car with trillium written on its side\" per_device_batch_size=1","  ```","","  Dev:","","  ```bash","  python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\"photograph of an electronics chip in the shape of a race car with trillium written on its side\" per_device_batch_size=1","  ```","","  If you are using a TPU v6e (Trillium), you can use optimized flash block sizes for faster inference. Uncomment Flux-dev [config](src/maxdiffusion/configs/base_flux_dev.yml#60) and Flux-schnell [config](src/maxdiffusion/configs/base_flux_schnell.yml#68)","","  To keep text encoders, vae and transformer on HBM memory at all times, the following command shards the model across devices.","","  ```bash","  python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=\"photograph of an electronics chip in the shape of a race car with trillium written on its side\" per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False","  ```","","  ### Flux.2-Klein (4B \u0026 9B)","","  Flux.2-Klein provides ultra-fast 4-step image generation using Qwen3 text embeddings and FLUX.2 transformer blocks.","","  #### Text-to-Image Generation:","","  Flux.2-Klein 4B:","","  ```bash","  python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein.yml run_name=flux2klein_4b prompt=\"A detailed vector illustration of a robotic hummingbird\"","  ```","","  Flux.2-Klein 9B:","","  ```bash","  python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b prompt=\"A detailed vector illustration of a robotic hummingbird\"","  ```","","  #### Multi-Reference Image Editing:","","  Flux.2-Klein supports multi-reference image editing conditioned on up to 4 reference images via the `image_paths` CLI flag.","","  Flux.2-Klein 9B Image Editing:","","  ```bash","  python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_image_edit prompt=\"change the lighting to evening\" image_paths=\"['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\"","  ```","","  The 9B model also supports KV-Cache for faster inference, and can be toggled with the `use_kv=True` CLI flag:","","  ```bash","  python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_kv_edit prompt=\"change the lighting to evening\" image_paths=\"['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']\" use_kv=True","  ```","  ## Fused Attention for GPU:","  Fused Attention for GPU is supported via TransformerEngine. Installation instructions:","","  ```bash","  cd maxdiffusion","  pip install -U \"jax[cuda12]\"","  pip install -r requirements.txt","  pip install --upgrade torch torchvision","  pip install \"transformer_engine[jax]","  pip install .","  ```","","  Now run the command:","","  ```bash","  NVTE_FUSED_ATTN=1 HF_HUB_ENABLE_HF_TRANSFER=1 python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 split_head_dim=True per_device_batch_size=1 attention=\"cudnn_flash_te\" hardware=gpu","  ```","  ## Wan LoRA","","  Disclaimer: not all LoRA formats have been tested. Currently supports ComfyUI and AI Toolkit formats. If there is a specific LoRA that doesn't load, please let us know.","","  First create a copy of the relevant config file eg: `src/maxdiffusion/configs/base_wan_{*}.yml`. Update the prompt and LoRA details in the config. Make sure to set `enable_lora: True`. Then run the following command:","","  ```bash","  HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \\","  LIBTPU_INIT_ARGS=\"--xla_tpu_enable_async_collective_fusion=true \\","  --xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \\","  --xla_tpu_enable_async_collective_fusion_multiple_steps=true \\","  --xla_tpu_overlap_compute_collective_tc=true \\","  --xla_enable_async_all_reduce=true\" \\","  HF_HUB_ENABLE_HF_TRANSFER=1 \\","  python src/maxdiffusion/generate_wan.py \\","  src/maxdiffusion/configs/base_wan_i2v_14b.yml \\   # --\u003e Change to your copy","  jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \\","  per_device_batch_size=.125 \\","  ici_data_parallelism=2 \\","  ici_context_parallelism=2 \\","  run_name=wan-lora-inference-testing-720p \\","  output_dir=gs:/jfacevedo-maxdiffusion \\","  seed=118445 \\","  enable_lora=True \\","  ```","","  Loading multiple LoRAs is supported as well.","","  ## Flux LoRA","","  Disclaimer: not all LoRA formats have been tested. If there is a specific LoRA that doesn't load, please let us know.","","  Tested with [Amateur Photography](https://civitai.com/models/652699/amateur-photography-flux-dev) and [XLabs-AI](https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main) LoRA collection.","","  First download the LoRA file to a local directory, for example, `/home/jfacevedo/anime_lora.safetensors`. Then run as follows:","","  ```bash","  python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{\"lora_model_name_or_path\" : [\"/home/jfacevedo/anime_lora.safetensors\"], \"weight_name\" : [\"anime_lora.safetensors\"], \"adapter_name\" : [\"anime\"], \"scale\": [0.8], \"from_pt\": [\"true\"]}'","  ```","","  Loading multiple LoRAs is supported as follows:","","  ```bash","  python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{\"lora_model_name_or_path\" : [\"/home/jfacevedo/anime_lora.safetensors\", \"/home/jfacevedo/amateurphoto-v6-forcu.safetensors\"], \"weight_name\" : [\"anime_lora.safetensors\",\"amateurphoto-v6-forcu.safetensors\"], \"adapter_name\" : [\"anime\",\"realistic\"], \"scale\": [0.6, 0.6], \"from_pt\": [\"true\",\"true\"]}'","  ```","","  ## Hyper SDXL LoRA","","  Supports Hyper-SDXL models from [ByteDance](https://huggingface.co/ByteDance/Hyper-SD)","","  ```bash","  python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\"test-lora\" output_dir=/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=2 do_classifier_free_guidance=False prompt=\"a photograph of a cat wearing a hat riding a skateboard in a park.\" per_device_batch_size=1 pretrained_model_name_or_path=\"Lykon/AAM_XL_AnimeMix\" from_pt=True revision=main diffusion_scheduler_config='{\"_class_name\" : \"FlaxDDIMScheduler\", \"timestep_spacing\" : \"trailing\"}' lora_config='{\"lora_model_name_or_path\" : [\"ByteDance/Hyper-SD\"], \"weight_name\" : [\"Hyper-SDXL-2steps-lora.safetensors\"], \"adapter_name\" : [\"hyper-sdxl\"], \"scale\": [0.7], \"from_pt\": [\"true\"]}'","  ```","","  ## Load Multiple LoRA","","  Supports loading multiple LoRAs for inference. Both from local or from HuggingFace hub.","","  ```bash","  python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=\"test-lora\" output_dir=/tmp/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=30 do_classifier_free_guidance=True prompt=\"ultra detailed diagram blueprint of a papercut Sitting MaineCoon cat, wide canvas, ampereart, electrical diagram, bl3uprint, papercut\" per_device_batch_size=1 diffusion_scheduler_config='{\"_class_name\" : \"FlaxDDIMScheduler\", \"timestep_spacing\" : \"trailing\"}' lora_config='{\"lora_model_name_or_path\" : [\"/home/jfacevedo/blueprintify-sd-xl-10.safetensors\",\"TheLastBen/Papercut_SDXL\"], \"weight_name\" : [\"/home/jfacevedo/blueprintify-sd-xl-10.safetensors\",\"papercut.safetensors\"], \"adapter_name\" : [\"blueprint\",\"papercut\"], \"scale\": [0.8, 0.7], \"from_pt\": [\"true\", \"true\"]}'","  ```","","  ## SDXL Lightning","","  Single and Multi host inference is supported with sharding annotations:","","  ```bash","  python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl_lightning.yml run_name=\"my_run\" lightning_repo=\"ByteDance/SDXL-Lightning\" lightning_ckpt=\"sdxl_lightning_4step_unet.safetensors\"","  ```","","  ## ControlNet","","  Might require installing extra libraries for opencv: `apt-get update \u0026\u0026 apt-get install ffmpeg libsm6 libxext6  -y`","","  ### Stable Diffusion 1.4","","  ```bash","  python src/maxdiffusion/controlnet/generate_controlnet_replicated.py","  ```","","  ### Stable Diffusion XL","","  ```bash","  python src/maxdiffusion/controlnet/generate_controlnet_sdxl_replicated.py","  ```","","## Getting Started: Multihost development","Multihost training for Stable Diffusion 2 base can be run using the following command:","```bash","TPU_NAME=\u003cyour-tpu-name\u003e","ZONE=\u003cyour-zone\u003e","PROJECT_ID=\u003cyour-project-id\u003e","gcloud compute tpus tpu-vm ssh $TPU_NAME --zone=$ZONE --project $PROJECT_ID --worker=all --command=\"","export LIBTPU_INIT_ARGS=\"\"","git clone https://github.com/google/maxdiffusion","cd maxdiffusion","pip3 install jax[tpu] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html","pip3 install -r requirements.txt","pip3 install .","python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=my_run output_dir=gs://your-bucket/\"","```","","# Comparison to Alternatives","","MaxDiffusion started as a fork of [Diffusers](https://github.com/huggingface/diffusers), a Hugging Face diffusion library written in Python, Pytorch and Jax. MaxDiffusion is compatible with Hugging Face Jax models. MaxDiffusion is more complex and was designed to run distributed across TPU Pods.","","# Development","","Whether you are forking MaxDiffusion for your own needs or intending to contribute back to the community, a full suite of tests can be found in `tests` and `src/maxdiffusion/tests`.","","To run unit tests simply run:","```bash","python -m pytest","```","","### Pre-commit Hooks","","We use [pre-commit](https://pre-commit.com/) to automatically check and format code before each commit (using `pyink`, `ruff`, `pylint`, and general git hygiene checks).","","\u003e **Important:** Make sure you are in your active virtual environment (e.g. `maxdiffusion_venv` or your active venv) before running `pre-commit install`, so that hooks run using the environment's installed dependencies.","","```bash","# 1. Activate your virtual environment first","source \u003cpath-to-venv\u003e/bin/activate","","# 2. Install pre-commit (if not already installed)","pip install pre-commit","","# 3. Install git pre-commit hooks","pre-commit install","```","","Once installed, pre-commit will automatically run on staged files whenever you run `git commit`.","","You can also run all pre-commit checks manually across the entire repository at any time:","","```bash","pre-commit run --all-files","```","","### Code Style","","This project uses `pylint` and `pyink` to enforce code style. Before submitting a pull request, please ensure your code passes these checks by running:","","```bash","bash code_style.sh","```","","This script will automatically format your code with `pyink` and help you identify any remaining style issues.","","","The full suite of -end-to end tests is in `tests` and `src/maxdiffusion/tests`. We run them with a nightly cadance.","","## Profiling","To learn how to enable ML Diagnostics and XProf profiling for your runs, please see our [ML Diagnostics Guide](docs/profiling.md).","","## Metrics","To learn how to enable ML Diagnostics metrics tracking for your runs, please see our [Metrics Guide](docs/metrics.md)."],"stylingDirectives":[[[0,4,"pl-c"],[0,4,"pl-c"]],[[0,26,"pl-c"]],[[0,0,"pl-c"]],[[0,64,"pl-c"]],[[0,65,"pl-c"]],[[0,40,"pl-c"]],[[0,0,"pl-c"]],[[0,49,"pl-c"]],[[0,0,"pl-c"]],[[0,68,"pl-c"]],[[0,66,"pl-c"]],[[0,73,"pl-c"]],[[0,68,"pl-c"]],[[0,31,"pl-c"]],[[0,4,"pl-c"],[1,4,"pl-c"]],[],[[0,1,"pl-s"],[1,3,"pl-s"],[13,14,"pl-s"],[14,15,"pl-s"],[15,105,"pl-corl"],[105,107,"pl-s"],[107,108,"pl-s"],[108,188,"pl-corl"],[188,189,"pl-s"]],[],[[0,13,"pl-mh"],[2,13,"pl-en"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"],[51,52,"pl-s"],[52,59,"pl-c1"],[59,60,"pl-s"],[61,62,"pl-s"],[62,70,"pl-c1"],[70,71,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"],[98,99,"pl-s"],[99,118,"pl-c1"],[118,119,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"],[77,78,"pl-s"],[78,102,"pl-c1"],[102,103,"pl-s"]],[[0,1,"pl-v"],[2,4,"pl-s"],[4,5,"pl-s"],[5,15,"pl-c1"],[15,16,"pl-s"],[16,18,"pl-s"]],[],[[0,10,"pl-mh"],[2,10,"pl-en"]],[],[],[],[],[],[],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[[0,1,"pl-v"]],[],[[0,2,"pl-s"],[22,24,"pl-s"]],[],[],[[0,19,"pl-mh"],[2,19,"pl-en"]],[],[[0,1,"pl-v"],[2,3,"pl-s"],[14,15,"pl-s"],[15,16,"pl-s"],[16,26,"pl-corl"],[26,27,"pl-s"]],[[0,1,"pl-v"],[2,3,"pl-s"],[11,12,"pl-s"],[12,13,"pl-s"],[13,22,"pl-corl"],[22,23,"pl-s"]],[[0,1,"pl-v"],[2,3,"pl-s"],[20,21,"pl-s"],[21,22,"pl-s"],[22,40,"pl-corl"],[40,41,"pl-s"]],[[0,1,"pl-v"],[2,3,"pl-s"],[18,19,"pl-s"],[19,20,"pl-s"],[20,36,"pl-corl"],[36,37,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[21,22,"pl-s"],[22,23,"pl-s"],[23,41,"pl-corl"],[41,42,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[21,22,"pl-s"],[22,23,"pl-s"],[23,40,"pl-corl"],[40,41,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[13,14,"pl-s"],[14,15,"pl-s"],[15,24,"pl-corl"],[24,25,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[13,14,"pl-s"],[14,15,"pl-s"],[15,31,"pl-corl"],[31,32,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[11,12,"pl-s"],[12,13,"pl-s"],[13,27,"pl-corl"],[27,28,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[11,12,"pl-s"],[12,13,"pl-s"],[13,42,"pl-corl"],[42,43,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[16,17,"pl-s"],[17,18,"pl-s"],[18,51,"pl-corl"],[51,52,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[13,14,"pl-s"],[14,15,"pl-s"],[15,44,"pl-corl"],[44,45,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[17,18,"pl-s"],[18,19,"pl-s"],[19,30,"pl-corl"],[30,31,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[14,15,"pl-s"],[15,16,"pl-s"],[16,26,"pl-corl"],[26,27,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[10,11,"pl-s"],[11,12,"pl-s"],[12,23,"pl-corl"],[23,24,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[16,17,"pl-s"],[17,18,"pl-s"],[18,28,"pl-corl"],[28,29,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[18,19,"pl-s"],[19,20,"pl-s"],[20,32,"pl-corl"],[32,33,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[11,12,"pl-s"],[12,13,"pl-s"],[13,18,"pl-corl"],[18,19,"pl-s"]],[[6,7,"pl-v"],[8,9,"pl-s"],[32,33,"pl-s"],[33,34,"pl-s"],[34,58,"pl-corl"],[58,59,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[11,12,"pl-s"],[12,13,"pl-s"],[13,33,"pl-corl"],[33,34,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[16,17,"pl-s"],[17,18,"pl-s"],[18,42,"pl-corl"],[42,43,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[13,14,"pl-s"],[14,15,"pl-s"],[15,35,"pl-corl"],[35,36,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[15,16,"pl-s"],[16,17,"pl-s"],[17,26,"pl-corl"],[26,27,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[16,17,"pl-s"],[17,18,"pl-s"],[18,28,"pl-corl"],[28,29,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[22,23,"pl-s"],[23,24,"pl-s"],[24,40,"pl-corl"],[40,41,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[25,26,"pl-s"],[26,27,"pl-s"],[27,46,"pl-corl"],[46,47,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[21,22,"pl-s"],[22,23,"pl-s"],[23,38,"pl-corl"],[38,39,"pl-s"]],[[4,5,"pl-v"],[6,7,"pl-s"],[17,18,"pl-s"],[18,19,"pl-s"],[19,30,"pl-corl"],[30,31,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[43,44,"pl-s"],[44,45,"pl-s"],[45,83,"pl-corl"],[83,84,"pl-s"]],[[0,1,"pl-v"],[2,3,"pl-s"],[29,30,"pl-s"],[30,31,"pl-s"],[31,58,"pl-corl"],[58,59,"pl-s"]],[[0,1,"pl-v"],[2,3,"pl-s"],[14,15,"pl-s"],[15,16,"pl-s"],[16,28,"pl-corl"],[28,29,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[14,15,"pl-s"],[15,16,"pl-s"],[16,26,"pl-corl"],[26,27,"pl-s"]],[[2,3,"pl-v"],[4,5,"pl-s"],[12,13,"pl-s"],[13,14,"pl-s"],[14,22,"pl-corl"],[22,23,"pl-s"]],[],[[0,17,"pl-mh"],[2,17,"pl-en"]],[],[],[],[],[],[[0,19,"pl-mh"],[3,19,"pl-en"]],[],[[62,63,"pl-s"],[75,76,"pl-s"],[76,77,"pl-s"],[77,110,"pl-corl"],[110,111,"pl-s"]],[],[[0,19,"pl-mh"],[3,19,"pl-en"]],[],[[64,65,"pl-s"],[77,78,"pl-s"],[78,79,"pl-s"],[79,96,"pl-corl"],[96,97,"pl-s"]],[],[[0,11,"pl-mh"],[3,11,"pl-en"]],[],[],[],[[0,21,"pl-mh"],[5,21,"pl-en"]],[],[],[],[[107,108,"pl-s"],[178,179,"pl-s"],[179,180,"pl-s"],[180,242,"pl-corl"],[242,243,"pl-s"]],[],[],[],[[0,25,"pl-mh"],[6,25,"pl-en"]],[],[[39,40,"pl-s"],[54,55,"pl-s"],[55,56,"pl-s"],[56,114,"pl-corl"],[114,115,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-k"]],[[2,8,"pl-k"]],[[86,101,"pl-smi"]],[[2,5,"pl-s"]],[],[[127,128,"pl-s"],[199,200,"pl-s"],[200,201,"pl-s"],[201,233,"pl-corl"],[233,234,"pl-s"],[249,250,"pl-s"],[254,255,"pl-s"],[255,256,"pl-s"],[256,329,"pl-corl"],[329,330,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[129,144,"pl-smi"],[159,181,"pl-smi"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[9,31,"pl-smi"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[129,144,"pl-smi"],[159,181,"pl-smi"]],[[2,5,"pl-s"]],[],[[167,168,"pl-s"],[168,173,"pl-c1"],[173,174,"pl-s"]],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-c1"],[9,15,"pl-s"],[9,10,"pl-pds"],[14,15,"pl-pds"],[16,38,"pl-smi"],[50,51,"pl-k"],[52,53,"pl-k"],[60,61,"pl-k"],[69,75,"pl-s"],[69,70,"pl-pds"],[74,75,"pl-pds"],[76,89,"pl-s"],[76,77,"pl-pds"],[88,89,"pl-pds"],[90,91,"pl-k"],[101,105,"pl-s"],[101,102,"pl-pds"],[104,105,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-c1"],[9,15,"pl-s"],[9,10,"pl-pds"],[14,15,"pl-pds"],[16,38,"pl-smi"],[50,51,"pl-k"],[52,53,"pl-k"],[60,61,"pl-k"],[69,75,"pl-s"],[69,70,"pl-pds"],[74,75,"pl-pds"],[76,89,"pl-s"],[76,77,"pl-pds"],[88,89,"pl-pds"],[90,91,"pl-k"],[101,105,"pl-s"],[101,102,"pl-pds"],[104,105,"pl-pds"],[106,110,"pl-c1"]],[[2,5,"pl-s"]],[],[[92,93,"pl-s"],[93,115,"pl-c1"],[115,116,"pl-s"]],[],[[2,5,"pl-s"],[5,5,"pl-c1"]],[[0,7,"pl-c1"]],[[0,16,"pl-c1"]],[[0,0,"pl-c1"],[2,5,"pl-s"]],[],[[34,35,"pl-s"],[35,52,"pl-c1"],[52,53,"pl-s"],[72,73,"pl-s"],[73,87,"pl-c1"],[87,88,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[5,27,"pl-smi"]],[[2,5,"pl-s"]],[],[[0,29,"pl-mh"],[6,29,"pl-en"]],[],[[82,83,"pl-s"],[83,86,"pl-c1"],[86,87,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[[32,54,"pl-smi"],[60,72,"pl-smi"],[73,101,"pl-smi"],[96,100,"pl-k"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[31,40,"pl-smi"]],[[18,30,"pl-smi"]],[[19,31,"pl-smi"],[32,60,"pl-smi"],[55,59,"pl-k"]],[[21,33,"pl-smi"],[34,62,"pl-smi"],[57,61,"pl-k"]],[[24,36,"pl-smi"],[37,65,"pl-smi"],[60,64,"pl-k"]],[[2,5,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-k"],[26,90,"pl-s"],[26,27,"pl-pds"]],[[0,45,"pl-s"]],[[0,46,"pl-s"]],[[0,48,"pl-s"]],[[0,54,"pl-s"]],[[0,56,"pl-s"]],[[0,49,"pl-s"]],[[0,64,"pl-s"]],[[0,48,"pl-s"]],[[0,38,"pl-s"]],[[0,41,"pl-s"]],[[0,42,"pl-s"]],[[0,61,"pl-s"]],[[0,60,"pl-s"]],[[0,44,"pl-s"]],[[0,52,"pl-s"]],[[0,55,"pl-s"]],[[0,62,"pl-s"]],[[0,55,"pl-s"]],[[0,43,"pl-s"]],[[0,55,"pl-s"]],[[0,42,"pl-s"]],[[0,61,"pl-s"]],[[0,64,"pl-s"]],[[0,50,"pl-s"],[49,50,"pl-pds"]],[[2,5,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[],[[12,19,"pl-s"],[12,13,"pl-pds"],[18,19,"pl-pds"]],[],[],[],[],[],[],[[11,22,"pl-smi"]],[[13,26,"pl-smi"]],[[17,31,"pl-smi"]],[],[],[],[],[],[[16,29,"pl-smi"]],[],[],[[24,43,"pl-smi"]],[[15,42,"pl-s"],[15,16,"pl-pds"],[41,42,"pl-pds"]],[],[[7,14,"pl-smi"]],[],[],[],[],[],[],[[2,5,"pl-s"]],[],[],[[2,3,"pl-v"]],[[2,3,"pl-v"],[76,77,"pl-s"],[77,81,"pl-c1"],[81,82,"pl-s"]],[[2,3,"pl-v"],[39,40,"pl-s"],[40,50,"pl-c1"],[50,51,"pl-s"]],[[2,3,"pl-v"]],[[4,5,"pl-v"]],[[4,5,"pl-v"]],[[2,3,"pl-v"]],[[4,5,"pl-v"]],[[4,5,"pl-v"]],[[2,3,"pl-v"]],[[4,5,"pl-v"]],[[4,5,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[[6,7,"pl-v"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,7,"pl-k"],[25,30,"pl-k"]],[],[[38,39,"pl-k"]],[],[],[[65,67,"pl-k"]],[[65,67,"pl-k"]],[[65,67,"pl-k"]],[[65,67,"pl-k"]],[],[[22,119,"pl-s"],[22,23,"pl-pds"],[118,119,"pl-pds"]],[],[],[],[],[],[],[[2,5,"pl-s"]],[],[[2,24,"pl-mh"],[6,24,"pl-en"]],[],[[191,192,"pl-s"],[202,203,"pl-s"],[203,204,"pl-s"],[204,252,"pl-corl"],[252,253,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[31,40,"pl-smi"]],[[18,30,"pl-smi"]],[[19,31,"pl-smi"],[32,60,"pl-smi"],[55,59,"pl-k"]],[[21,33,"pl-smi"],[34,62,"pl-smi"],[57,61,"pl-k"]],[[24,36,"pl-smi"],[37,65,"pl-smi"],[60,64,"pl-k"]],[[2,5,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[19,83,"pl-s"],[19,20,"pl-pds"]],[[0,45,"pl-s"]],[[0,46,"pl-s"]],[[0,48,"pl-s"]],[[0,54,"pl-s"]],[[0,56,"pl-s"]],[[0,49,"pl-s"]],[[0,64,"pl-s"]],[[0,48,"pl-s"]],[[0,38,"pl-s"]],[[0,41,"pl-s"]],[[0,42,"pl-s"]],[[0,61,"pl-s"]],[[0,60,"pl-s"]],[[0,44,"pl-s"]],[[0,52,"pl-s"]],[[0,55,"pl-s"]],[[0,62,"pl-s"]],[[0,55,"pl-s"]],[[0,43,"pl-s"]],[[0,55,"pl-s"]],[[0,42,"pl-s"]],[[0,61,"pl-s"]],[[0,64,"pl-s"]],[[0,50,"pl-s"],[49,50,"pl-pds"]],[[2,5,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[10,11,"pl-k"]],[[12,25,"pl-smi"]],[[12,20,"pl-smi"]],[[9,14,"pl-smi"]],[[16,28,"pl-smi"]],[],[[12,15,"pl-s"],[12,13,"pl-pds"],[14,15,"pl-cce"]],[[0,101,"pl-s"],[100,101,"pl-cce"]],[[0,45,"pl-s"],[44,45,"pl-cce"]],[[0,21,"pl-s"],[20,21,"pl-cce"]],[[0,26,"pl-s"],[25,26,"pl-cce"]],[[0,30,"pl-s"],[29,30,"pl-cce"]],[[0,22,"pl-s"],[21,22,"pl-cce"]],[[0,18,"pl-s"],[17,18,"pl-cce"]],[[0,10,"pl-s"],[9,10,"pl-cce"]],[[0,37,"pl-s"],[36,37,"pl-cce"]],[[0,24,"pl-s"],[11,22,"pl-smi"],[23,24,"pl-cce"]],[[0,28,"pl-s"],[13,26,"pl-smi"],[27,28,"pl-cce"]],[[0,33,"pl-s"],[17,31,"pl-smi"],[32,33,"pl-cce"]],[[0,29,"pl-s"],[28,29,"pl-cce"]],[[0,15,"pl-s"],[14,15,"pl-cce"]],[[0,13,"pl-s"],[12,13,"pl-cce"]],[[0,17,"pl-s"],[16,17,"pl-cce"]],[[0,26,"pl-s"],[25,26,"pl-cce"]],[[0,42,"pl-s"],[16,29,"pl-smi"],[41,42,"pl-cce"]],[[0,24,"pl-s"],[23,24,"pl-cce"]],[[0,45,"pl-s"],[24,43,"pl-smi"],[44,45,"pl-cce"]],[[0,44,"pl-s"],[43,44,"pl-cce"]],[[0,26,"pl-s"],[25,26,"pl-cce"]],[[0,16,"pl-s"],[7,14,"pl-smi"],[15,16,"pl-cce"]],[[0,37,"pl-s"],[36,37,"pl-cce"]],[[0,20,"pl-s"],[19,20,"pl-cce"]],[[0,30,"pl-s"],[29,30,"pl-cce"]],[[0,27,"pl-s"],[26,27,"pl-cce"]],[[0,26,"pl-s"],[25,26,"pl-cce"]],[[0,28,"pl-s"],[27,28,"pl-cce"]],[[0,24,"pl-s"],[23,24,"pl-cce"]],[[0,18,"pl-s"],[17,18,"pl-cce"]],[[0,34,"pl-s"],[16,32,"pl-smi"],[33,34,"pl-cce"]],[[0,38,"pl-s"],[37,38,"pl-pds"]],[[22,34,"pl-smi"]],[],[[13,24,"pl-smi"]],[],[],[[2,5,"pl-s"]],[],[[2,18,"pl-mh"],[5,18,"pl-en"]],[],[],[],[[2,3,"pl-ml"],[10,11,"pl-ml"],[24,25,"pl-ml"],[44,45,"pl-ml"],[68,69,"pl-ml"],[88,89,"pl-ml"],[107,108,"pl-ml"]],[[2,3,"pl-ml"],[8,9,"pl-ml"],[14,15,"pl-ml"],[20,21,"pl-ml"],[26,27,"pl-ml"],[32,33,"pl-ml"],[38,39,"pl-ml"]],[[2,3,"pl-ml"],[13,14,"pl-ml"],[21,22,"pl-ml"],[28,29,"pl-ml"],[32,33,"pl-ml"],[36,37,"pl-ml"],[44,45,"pl-ml"]],[],[],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[[15,30,"pl-s"],[15,16,"pl-pds"],[29,30,"pl-pds"]],[[17,42,"pl-s"],[17,18,"pl-pds"],[41,42,"pl-pds"]],[[20,36,"pl-s"],[20,21,"pl-pds"],[35,36,"pl-pds"]],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[105,122,"pl-s"],[105,106,"pl-pds"],[121,122,"pl-pds"],[134,159,"pl-s"],[134,135,"pl-pds"],[158,159,"pl-pds"],[174,190,"pl-s"],[174,175,"pl-pds"],[189,190,"pl-pds"]],[[2,5,"pl-s"]],[],[[2,33,"pl-mh"],[5,33,"pl-en"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-k"],[26,28,"pl-s"],[26,27,"pl-pds"],[27,28,"pl-pds"]],[[86,97,"pl-s"],[86,87,"pl-pds"],[96,97,"pl-pds"],[109,128,"pl-s"],[109,110,"pl-pds"],[127,128,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[52,53,"pl-s"],[70,71,"pl-s"],[71,72,"pl-s"],[72,96,"pl-corl"],[96,97,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[117,134,"pl-s"],[117,118,"pl-pds"],[133,134,"pl-pds"],[329,345,"pl-s"],[329,330,"pl-pds"],[344,345,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[84,92,"pl-s"],[84,85,"pl-pds"],[91,92,"pl-pds"],[123,124,"pl-k"],[150,151,"pl-k"]],[[2,5,"pl-s"]],[],[[2,37,"pl-mh"],[5,37,"pl-en"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-k"],[26,28,"pl-s"],[26,27,"pl-pds"],[27,28,"pl-pds"]],[[85,93,"pl-s"],[85,86,"pl-pds"],[92,93,"pl-pds"]],[[2,5,"pl-s"]],[],[[2,34,"pl-mh"],[5,34,"pl-en"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,8,"pl-k"],[26,28,"pl-s"],[26,27,"pl-pds"],[27,28,"pl-pds"]],[[80,88,"pl-s"],[80,81,"pl-pds"],[87,88,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[88,96,"pl-s"],[88,89,"pl-pds"],[95,96,"pl-pds"]],[[2,5,"pl-s"]],[],[[2,15,"pl-mh"],[5,15,"pl-en"]],[],[[23,25,"pl-s"],[49,51,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[108,109,"pl-k"],[123,124,"pl-k"],[143,144,"pl-k"],[161,162,"pl-k"],[179,200,"pl-s"],[179,180,"pl-pds"],[199,200,"pl-pds"],[214,230,"pl-s"],[214,215,"pl-pds"],[229,230,"pl-pds"],[265,266,"pl-k"],[280,281,"pl-k"],[295,313,"pl-s"],[295,296,"pl-pds"],[312,313,"pl-pds"],[507,508,"pl-k"],[521,522,"pl-k"],[539,540,"pl-k"],[556,557,"pl-k"]],[[2,5,"pl-s"]],[],[[0,12,"pl-mh"],[3,12,"pl-en"]],[],[],[[0,24,"pl-mh"],[5,24,"pl-en"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[89,97,"pl-s"],[89,90,"pl-pds"],[96,97,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[[2,5,"pl-s"]],[],[[0,28,"pl-mh"],[5,28,"pl-en"]],[[2,5,"pl-s"],[5,9,"pl-en"]],[[88,96,"pl-s"],[88,89,"pl-pds"],[95,96,"pl-pds"]],[[2,5,"pl-s"]],[],[[0,25,"pl-mh"],[5,25,"pl-en"]],[[2,5,"pl-s"],[5,9,"pl-en"]],[[83,91,"pl-s"],[83,84,"pl-pds"],[90,91,"pl-pds"]],[[2,5,"pl-s"]],[],[[0,14,"pl-mh"],[5,14,"pl-en"]],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[[2,5,"pl-s"]],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[98,116,"pl-s"],[98,99,"pl-pds"],[115,116,"pl-pds"],[129,178,"pl-s"],[129,130,"pl-pds"],[177,178,"pl-pds"]],[[2,5,"pl-s"]],[],[],[[73,74,"pl-s"],[86,87,"pl-s"]],[],[[0,16,"pl-mh"],[5,16,"pl-en"]],[],[[107,108,"pl-s"],[178,179,"pl-s"],[179,180,"pl-s"],[180,242,"pl-corl"],[242,243,"pl-s"]],[],[],[],[[3,6,"pl-s"],[6,10,"pl-en"]],[],[[19,67,"pl-s"],[19,20,"pl-pds"],[66,67,"pl-cce"]],[[0,65,"pl-s"],[64,65,"pl-cce"]],[[0,64,"pl-s"],[63,64,"pl-cce"]],[[0,48,"pl-s"],[47,48,"pl-cce"]],[[0,37,"pl-s"],[36,37,"pl-pds"]],[],[],[],[[12,19,"pl-s"],[12,13,"pl-pds"],[18,19,"pl-pds"]],[],[],[],[],[],[],[],[],[[2,5,"pl-s"]],[],[[0,15,"pl-mh"],[5,15,"pl-en"]],[],[[107,108,"pl-s"],[178,179,"pl-s"],[179,180,"pl-s"],[180,242,"pl-corl"],[242,243,"pl-s"]],[],[],[],[[2,4,"pl-s"],[8,10,"pl-s"]],[],[],[],[],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[[19,67,"pl-s"],[19,20,"pl-pds"],[66,67,"pl-cce"]],[[0,65,"pl-s"],[64,65,"pl-cce"]],[[0,64,"pl-s"],[63,64,"pl-cce"]],[[0,48,"pl-s"],[47,48,"pl-cce"]],[[0,37,"pl-s"],[36,37,"pl-pds"]],[],[],[],[[12,19,"pl-s"],[12,13,"pl-pds"],[18,19,"pl-pds"]],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[[20,205,"pl-s"],[20,21,"pl-pds"],[204,205,"pl-pds"]],[],[[2,5,"pl-s"]],[],[],[],[[2,3,"pl-v"],[24,25,"pl-s"],[25,45,"pl-c1"],[45,46,"pl-s"]],[[2,3,"pl-v"],[24,25,"pl-s"],[25,41,"pl-c1"],[41,42,"pl-s"]],[[2,3,"pl-v"],[24,25,"pl-s"],[25,45,"pl-c1"],[45,46,"pl-s"]],[],[[2,23,"pl-mh"],[6,23,"pl-en"]],[],[[86,87,"pl-s"],[87,106,"pl-c1"],[106,107,"pl-s"]],[],[[174,175,"pl-s"],[280,281,"pl-s"],[281,282,"pl-s"],[282,314,"pl-corl"],[314,315,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[],[[12,21,"pl-s"],[12,13,"pl-pds"],[20,21,"pl-pds"]],[],[],[[2,5,"pl-s"]],[],[[19,20,"pl-s"],[20,43,"pl-c1"],[43,44,"pl-s"],[141,142,"pl-s"],[142,159,"pl-c1"],[159,160,"pl-s"]],[],[[69,70,"pl-s"],[70,78,"pl-c1"],[78,79,"pl-s"],[135,136,"pl-s"],[136,140,"pl-c1"],[140,141,"pl-s"],[184,185,"pl-s"],[185,189,"pl-c1"],[189,190,"pl-s"]],[],[[2,72,"pl-mh"],[7,72,"pl-en"]],[],[[25,26,"pl-s"],[26,36,"pl-c1"],[36,37,"pl-s"],[173,175,"pl-s"],[200,202,"pl-s"]],[],[[13,14,"pl-s"],[14,38,"pl-c1"],[38,39,"pl-s"]],[],[[83,84,"pl-s"],[84,103,"pl-c1"],[103,104,"pl-s"],[164,165,"pl-s"],[165,189,"pl-c1"],[189,190,"pl-s"]],[],[[76,77,"pl-s"],[77,103,"pl-c1"],[103,104,"pl-s"],[108,109,"pl-s"],[109,135,"pl-c1"],[135,136,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[],[],[[12,21,"pl-s"],[12,13,"pl-pds"],[20,21,"pl-pds"]],[],[],[],[[2,5,"pl-s"]],[],[[2,16,"pl-ent"],[2,4,"pl-ent"],[4,5,"pl-s"],[15,16,"pl-s"]],[[0,0,"pl-ent"],[2,118,"pl-ent"],[2,4,"pl-ent"]],[[0,0,"pl-ent"],[2,11,"pl-ent"],[2,4,"pl-ent"],[4,7,"pl-s"],[7,11,"pl-en"]],[[0,106,"pl-ent"],[2,3,"pl-k"],[4,10,"pl-k"],[21,106,"pl-s"],[21,22,"pl-pds"],[105,106,"pl-pds"]],[[0,7,"pl-ent"],[2,3,"pl-k"],[4,7,"pl-s"],[4,5,"pl-pds"],[5,6,"pl-pds"],[6,7,"pl-pds"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,24,"pl-ent"],[0,24,"pl-s"],[2,24,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,190,"pl-ent"],[0,190,"pl-s"],[139,141,"pl-k"],[159,161,"pl-k"],[164,170,"pl-c1"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,76,"pl-ent"],[0,76,"pl-s"],[2,3,"pl-k"],[15,16,"pl-k"],[29,30,"pl-k"],[51,52,"pl-k"],[61,62,"pl-k"],[75,76,"pl-k"]],[[0,33,"pl-ent"],[0,33,"pl-s"],[2,3,"pl-k"],[8,9,"pl-k"],[14,15,"pl-k"],[20,21,"pl-k"],[26,27,"pl-k"],[32,33,"pl-k"]],[[0,199,"pl-ent"],[0,21,"pl-s"],[2,3,"pl-k"],[4,6,"pl-k"],[15,17,"pl-k"],[18,19,"pl-k"],[20,21,"pl-pds"],[40,199,"pl-s"],[40,41,"pl-pds"],[42,43,"pl-k"],[73,74,"pl-k"],[75,76,"pl-k"],[81,82,"pl-k"],[198,199,"pl-k"]],[[0,306,"pl-ent"],[0,20,"pl-s"],[2,3,"pl-k"],[4,6,"pl-k"],[14,16,"pl-k"],[17,18,"pl-k"],[19,20,"pl-pds"],[39,306,"pl-s"],[39,40,"pl-pds"],[41,42,"pl-k"],[59,60,"pl-k"],[61,62,"pl-k"],[67,68,"pl-k"],[221,223,"pl-cce"],[225,227,"pl-cce"],[305,306,"pl-k"]],[[0,447,"pl-ent"],[0,20,"pl-s"],[2,3,"pl-k"],[4,6,"pl-k"],[14,16,"pl-k"],[17,18,"pl-k"],[19,20,"pl-pds"],[38,259,"pl-s"],[38,39,"pl-pds"],[40,41,"pl-k"],[71,72,"pl-k"],[73,74,"pl-k"],[84,85,"pl-k"],[258,259,"pl-pds"],[274,288,"pl-s"],[274,275,"pl-pds"],[287,288,"pl-pds"],[298,350,"pl-s"],[298,299,"pl-pds"],[349,350,"pl-pds"],[365,447,"pl-s"],[365,366,"pl-pds"],[446,447,"pl-k"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,433,"pl-ent"],[0,58,"pl-s"],[57,58,"pl-pds"],[73,140,"pl-s"],[73,74,"pl-pds"],[125,128,"pl-k"],[139,140,"pl-pds"],[155,433,"pl-s"],[155,156,"pl-pds"],[301,319,"pl-s"],[301,302,"pl-pds"],[318,319,"pl-pds"],[320,323,"pl-k"],[329,351,"pl-s"],[329,330,"pl-pds"],[350,351,"pl-pds"],[352,355,"pl-k"],[360,361,"pl-k"],[374,377,"pl-k"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,262,"pl-ent"],[0,28,"pl-s"],[2,3,"pl-k"],[4,6,"pl-k"],[27,28,"pl-pds"],[43,107,"pl-s"],[43,44,"pl-pds"],[44,46,"pl-k"],[106,107,"pl-pds"],[122,262,"pl-s"],[122,123,"pl-pds"],[155,160,"pl-c1"],[167,172,"pl-s"],[167,168,"pl-pds"],[171,172,"pl-pds"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,140,"pl-ent"],[0,140,"pl-s"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,48,"pl-ent"],[0,48,"pl-s"],[2,3,"pl-k"],[12,13,"pl-k"],[23,24,"pl-k"],[33,34,"pl-k"],[47,48,"pl-k"]],[[0,27,"pl-ent"],[0,27,"pl-s"],[2,3,"pl-k"],[8,9,"pl-k"],[14,15,"pl-k"],[20,21,"pl-k"],[26,27,"pl-k"]],[[0,111,"pl-ent"],[0,11,"pl-s"],[2,3,"pl-k"],[8,9,"pl-k"],[10,11,"pl-pds"],[26,30,"pl-s"],[26,27,"pl-pds"],[29,30,"pl-pds"],[50,54,"pl-s"],[50,51,"pl-pds"],[53,54,"pl-pds"],[66,111,"pl-s"],[66,67,"pl-pds"],[68,69,"pl-k"],[70,71,"pl-k"],[93,94,"pl-k"],[110,111,"pl-k"]],[[0,134,"pl-ent"],[0,11,"pl-s"],[2,3,"pl-k"],[8,9,"pl-k"],[10,11,"pl-pds"],[25,29,"pl-s"],[25,26,"pl-pds"],[28,29,"pl-pds"],[49,53,"pl-s"],[49,50,"pl-pds"],[52,53,"pl-pds"],[73,77,"pl-s"],[73,74,"pl-pds"],[76,77,"pl-pds"],[89,134,"pl-s"],[89,90,"pl-pds"],[91,92,"pl-k"],[93,94,"pl-k"],[116,117,"pl-k"],[133,134,"pl-k"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,118,"pl-ent"],[0,118,"pl-s"],[5,11,"pl-c1"],[33,36,"pl-c1"],[60,62,"pl-k"]],[[0,0,"pl-ent"],[0,0,"pl-s"]],[[0,9,"pl-ent"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,44,"pl-ent"],[2,44,"pl-c"],[2,3,"pl-c"]],[[0,43,"pl-ent"]],[[0,47,"pl-ent"]],[[0,24,"pl-ent"]],[[0,7,"pl-ent"]],[[0,0,"pl-ent"]],[[0,45,"pl-ent"],[2,45,"pl-c"],[2,3,"pl-c"]],[[0,43,"pl-ent"]],[[0,51,"pl-ent"]],[[0,24,"pl-ent"]],[[0,7,"pl-ent"]],[[0,0,"pl-ent"]],[[0,42,"pl-ent"],[0,42,"pl-c"],[0,1,"pl-c"]],[[0,41,"pl-ent"]],[[0,45,"pl-ent"]],[[0,21,"pl-ent"]],[[0,24,"pl-ent"]],[[0,16,"pl-ent"]],[[0,5,"pl-ent"]],[[0,0,"pl-ent"]],[[0,42,"pl-ent"],[0,42,"pl-c"],[0,1,"pl-c"]],[[0,41,"pl-ent"]],[[0,49,"pl-ent"]],[[0,21,"pl-ent"]],[[0,24,"pl-ent"]],[[0,16,"pl-ent"]],[[0,5,"pl-ent"]],[[0,3,"pl-ent"],[0,3,"pl-s"]],[[0,0,"pl-ent"]],[[0,18,"pl-mh"],[4,18,"pl-en"]],[[76,77,"pl-s"],[77,81,"pl-c1"],[81,82,"pl-s"]],[[0,1,"pl-ml"],[14,15,"pl-ml"],[23,24,"pl-ml"],[40,41,"pl-ml"],[58,59,"pl-ml"],[69,70,"pl-ml"],[91,92,"pl-ml"]],[[0,1,"pl-ml"],[5,6,"pl-ml"],[10,11,"pl-ml"],[15,16,"pl-ml"],[20,21,"pl-ml"],[25,26,"pl-ml"],[30,31,"pl-ml"]],[[0,1,"pl-ml"],[8,9,"pl-ml"],[18,19,"pl-ml"],[34,35,"pl-ml"],[39,40,"pl-ml"],[64,65,"pl-ml"],[66,68,"pl-s"],[73,75,"pl-s"],[76,77,"pl-ml"]],[[0,1,"pl-ml"],[8,9,"pl-ml"],[18,19,"pl-ml"],[33,34,"pl-ml"],[38,39,"pl-ml"],[63,64,"pl-ml"],[71,72,"pl-ml"]],[[0,1,"pl-ml"],[8,9,"pl-ml"],[18,19,"pl-ml"],[34,35,"pl-ml"],[39,40,"pl-ml"],[64,65,"pl-ml"],[66,68,"pl-s"],[73,75,"pl-s"],[76,77,"pl-ml"]],[[0,1,"pl-ml"],[8,9,"pl-ml"],[18,19,"pl-ml"],[33,34,"pl-ml"],[38,39,"pl-ml"],[63,64,"pl-ml"],[71,72,"pl-ml"]],[],[[0,1,"pl-ml"],[14,15,"pl-ml"],[23,24,"pl-ml"],[40,41,"pl-ml"],[58,59,"pl-ml"],[69,70,"pl-ml"],[91,92,"pl-ml"]],[[0,1,"pl-ml"],[5,6,"pl-ml"],[10,11,"pl-ml"],[15,16,"pl-ml"],[20,21,"pl-ml"],[25,26,"pl-ml"],[30,31,"pl-ml"]],[[0,1,"pl-ml"],[9,10,"pl-ml"],[19,20,"pl-ml"],[35,36,"pl-ml"],[40,41,"pl-ml"],[65,66,"pl-ml"],[67,69,"pl-s"],[74,76,"pl-s"],[77,78,"pl-ml"]],[[0,1,"pl-ml"],[9,10,"pl-ml"],[19,20,"pl-ml"],[34,35,"pl-ml"],[39,40,"pl-ml"],[64,65,"pl-ml"],[72,73,"pl-ml"]],[[0,1,"pl-ml"],[9,10,"pl-ml"],[19,20,"pl-ml"],[35,36,"pl-ml"],[40,41,"pl-ml"],[65,66,"pl-ml"],[67,69,"pl-s"],[74,76,"pl-s"],[77,78,"pl-ml"]],[[0,1,"pl-ml"],[9,10,"pl-ml"],[19,20,"pl-ml"],[34,35,"pl-ml"],[39,40,"pl-ml"],[64,65,"pl-ml"],[72,73,"pl-ml"]],[],[[1,2,"pl-s"],[83,84,"pl-s"],[84,97,"pl-c1"],[97,98,"pl-s"]],[],[[0,30,"pl-mh"],[4,30,"pl-en"]],[],[[34,35,"pl-s"],[35,42,"pl-c1"],[42,43,"pl-s"],[46,47,"pl-s"],[47,55,"pl-c1"],[55,56,"pl-s"],[226,227,"pl-s"],[227,250,"pl-c1"],[250,251,"pl-s"],[255,256,"pl-s"],[256,271,"pl-c1"],[271,272,"pl-s"],[369,370,"pl-s"],[370,387,"pl-c1"],[387,388,"pl-s"],[390,391,"pl-s"],[391,413,"pl-c1"],[413,414,"pl-s"],[498,499,"pl-s"],[499,529,"pl-c1"],[529,530,"pl-s"],[555,556,"pl-s"],[556,584,"pl-c1"],[584,585,"pl-s"],[619,620,"pl-s"],[620,687,"pl-c1"],[687,688,"pl-s"]],[],[[0,9,"pl-mh"],[5,9,"pl-en"]],[],[],[],[],[],[[2,3,"pl-ml"],[10,11,"pl-ml"],[24,25,"pl-ml"],[44,45,"pl-ml"],[57,58,"pl-ml"],[65,66,"pl-ml"],[79,80,"pl-ml"]],[[2,3,"pl-ml"],[8,9,"pl-ml"],[14,15,"pl-ml"],[20,21,"pl-ml"],[26,27,"pl-ml"],[32,33,"pl-ml"],[38,39,"pl-ml"]],[[2,3,"pl-ml"],[13,14,"pl-ml"],[20,21,"pl-ml"],[26,27,"pl-ml"],[30,31,"pl-ml"],[35,36,"pl-ml"],[40,41,"pl-ml"]],[[2,3,"pl-ml"],[17,18,"pl-ml"],[24,25,"pl-ml"],[30,31,"pl-ml"],[34,35,"pl-ml"],[38,39,"pl-ml"],[44,45,"pl-ml"]],[[2,3,"pl-ml"],[13,14,"pl-ml"],[21,22,"pl-ml"],[27,28,"pl-ml"],[31,32,"pl-ml"],[36,37,"pl-ml"],[42,43,"pl-ml"]],[[2,3,"pl-ml"],[17,18,"pl-ml"],[25,26,"pl-ml"],[31,32,"pl-ml"],[35,36,"pl-ml"],[39,40,"pl-ml"],[45,46,"pl-ml"]],[[2,3,"pl-ml"],[17,18,"pl-ml"],[25,26,"pl-ml"],[32,33,"pl-ml"],[36,37,"pl-ml"],[40,41,"pl-ml"],[46,47,"pl-ml"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[162,258,"pl-s"],[162,163,"pl-pds"],[257,258,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[158,254,"pl-s"],[158,159,"pl-pds"],[253,254,"pl-pds"]],[[2,5,"pl-s"]],[],[[122,123,"pl-s"],[129,130,"pl-s"],[130,131,"pl-s"],[131,176,"pl-corl"],[176,177,"pl-s"],[195,196,"pl-s"],[202,203,"pl-s"],[203,204,"pl-s"],[204,253,"pl-corl"],[253,254,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[162,258,"pl-s"],[162,163,"pl-pds"],[257,258,"pl-pds"]],[[2,5,"pl-s"]],[],[[0,28,"pl-mh"],[6,28,"pl-en"]],[],[],[],[[0,32,"pl-mh"],[7,32,"pl-en"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[124,181,"pl-s"],[124,125,"pl-pds"],[180,181,"pl-pds"]],[[2,5,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[127,184,"pl-s"],[127,128,"pl-pds"],[183,184,"pl-pds"]],[[2,5,"pl-s"]],[],[[0,37,"pl-mh"],[7,37,"pl-en"]],[],[[102,103,"pl-s"],[103,114,"pl-c1"],[114,115,"pl-s"]],[],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[138,170,"pl-s"],[138,139,"pl-pds"],[169,170,"pl-pds"],[183,251,"pl-s"],[183,184,"pl-pds"],[250,251,"pl-pds"]],[[2,5,"pl-s"]],[],[[88,89,"pl-s"],[89,100,"pl-c1"],[100,101,"pl-s"]],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[135,167,"pl-s"],[135,136,"pl-pds"],[166,167,"pl-pds"],[180,248,"pl-s"],[180,181,"pl-pds"],[247,248,"pl-pds"]],[[2,5,"pl-s"]],[[0,29,"pl-mh"],[5,29,"pl-en"]],[],[],[[2,5,"pl-s"],[5,9,"pl-en"]],[[2,4,"pl-c1"]],[[17,30,"pl-s"],[17,18,"pl-pds"],[29,30,"pl-pds"]],[],[],[[14,38,"pl-s"],[14,15,"pl-pds"]],[[0,15,"pl-s"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,22,"pl-s"],[0,22,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,339,"pl-s"],[338,339,"pl-pds"],[353,367,"pl-s"],[353,354,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,13,"pl-s"],[0,13,"pl-s"],[2,13,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,170,"pl-s"],[0,170,"pl-s"],[142,170,"pl-s"],[142,143,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,218,"pl-s"],[0,218,"pl-s"],[0,218,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,9,"pl-s"],[0,9,"pl-s"]],[[0,64,"pl-s"],[0,64,"pl-s"],[0,64,"pl-s"]],[[0,67,"pl-s"],[0,67,"pl-s"],[0,67,"pl-s"]],[[0,65,"pl-s"],[0,65,"pl-s"],[0,65,"pl-s"]],[[0,64,"pl-s"],[0,64,"pl-s"],[0,64,"pl-s"]],[[0,48,"pl-s"],[0,48,"pl-s"],[0,48,"pl-s"]],[[0,39,"pl-s"],[0,39,"pl-s"],[0,39,"pl-s"]],[[0,31,"pl-s"],[0,31,"pl-s"],[0,31,"pl-s"]],[[0,43,"pl-s"],[0,43,"pl-s"],[0,43,"pl-s"]],[[0,77,"pl-s"],[0,77,"pl-s"],[0,77,"pl-s"]],[[0,56,"pl-s"],[0,56,"pl-s"],[0,56,"pl-s"]],[[0,30,"pl-s"],[0,30,"pl-s"],[0,30,"pl-s"]],[[0,26,"pl-s"],[0,26,"pl-s"],[0,26,"pl-s"]],[[0,29,"pl-s"],[0,29,"pl-s"],[0,29,"pl-s"]],[[0,44,"pl-s"],[0,44,"pl-s"],[0,44,"pl-s"]],[[0,41,"pl-s"],[0,41,"pl-s"],[0,41,"pl-s"]],[[0,15,"pl-s"],[0,15,"pl-s"],[0,15,"pl-s"]],[[0,20,"pl-s"],[0,20,"pl-s"],[0,20,"pl-s"]],[[0,5,"pl-s"],[0,5,"pl-s"],[0,5,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,46,"pl-s"],[0,46,"pl-s"],[0,46,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,14,"pl-s"],[0,14,"pl-s"],[0,14,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,119,"pl-s"],[0,119,"pl-s"],[0,92,"pl-s"],[91,92,"pl-pds"],[107,110,"pl-c1"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,195,"pl-s"],[0,195,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,128,"pl-s"],[0,67,"pl-s"],[36,41,"pl-k"],[53,56,"pl-k"],[66,67,"pl-pds"],[105,128,"pl-s"],[105,106,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,320,"pl-s"],[319,320,"pl-pds"],[343,349,"pl-s"],[343,344,"pl-pds"],[348,349,"pl-pds"],[387,392,"pl-s"],[387,388,"pl-pds"],[391,392,"pl-pds"],[403,409,"pl-s"],[403,404,"pl-pds"],[408,409,"pl-pds"],[431,436,"pl-s"],[431,432,"pl-pds"],[435,436,"pl-pds"],[448,454,"pl-s"],[448,449,"pl-pds"],[453,454,"pl-pds"],[459,464,"pl-s"],[459,460,"pl-pds"],[463,464,"pl-pds"],[469,480,"pl-s"],[469,470,"pl-pds"],[479,480,"pl-pds"],[487,492,"pl-s"],[487,488,"pl-pds"],[491,492,"pl-pds"],[496,500,"pl-s"],[496,497,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,49,"pl-s"],[0,49,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,320,"pl-s"],[319,320,"pl-pds"],[343,349,"pl-s"],[343,344,"pl-pds"],[348,349,"pl-pds"],[387,391,"pl-s"],[387,388,"pl-pds"],[390,391,"pl-pds"],[440,445,"pl-s"],[440,441,"pl-pds"],[444,445,"pl-pds"],[456,462,"pl-s"],[456,457,"pl-pds"],[461,462,"pl-pds"],[484,487,"pl-s"],[484,485,"pl-pds"],[486,487,"pl-pds"],[520,525,"pl-s"],[520,521,"pl-pds"],[524,525,"pl-pds"],[537,543,"pl-s"],[537,538,"pl-pds"],[542,543,"pl-pds"],[548,551,"pl-s"],[548,549,"pl-pds"],[550,551,"pl-pds"],[560,565,"pl-s"],[560,561,"pl-pds"],[564,565,"pl-pds"],[570,586,"pl-s"],[570,571,"pl-pds"],[585,586,"pl-pds"],[593,598,"pl-s"],[593,594,"pl-pds"],[597,598,"pl-pds"],[602,605,"pl-s"],[602,603,"pl-pds"],[604,605,"pl-pds"],[609,613,"pl-s"],[609,610,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,20,"pl-s"],[0,20,"pl-s"],[2,20,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,88,"pl-s"],[0,88,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,90,"pl-s"],[89,90,"pl-pds"],[99,212,"pl-s"],[99,100,"pl-pds"],[211,212,"pl-pds"],[268,270,"pl-k"],[278,335,"pl-s"],[278,279,"pl-pds"],[334,335,"pl-pds"],[356,415,"pl-s"],[356,357,"pl-pds"],[414,415,"pl-pds"],[426,431,"pl-s"],[426,427,"pl-pds"],[430,431,"pl-pds"],[448,452,"pl-s"],[448,449,"pl-pds"],[451,452,"pl-pds"],[468,473,"pl-s"],[468,469,"pl-pds"],[472,473,"pl-pds"],[481,500,"pl-s"],[481,482,"pl-pds"],[499,500,"pl-pds"],[523,529,"pl-s"],[523,524,"pl-pds"],[528,529,"pl-pds"],[547,552,"pl-s"],[547,548,"pl-pds"],[551,552,"pl-pds"],[563,569,"pl-s"],[563,564,"pl-pds"],[568,569,"pl-pds"],[603,608,"pl-s"],[603,604,"pl-pds"],[607,608,"pl-pds"],[620,626,"pl-s"],[620,621,"pl-pds"],[625,626,"pl-pds"],[636,641,"pl-s"],[636,637,"pl-pds"],[640,641,"pl-pds"],[646,657,"pl-s"],[646,647,"pl-pds"],[656,657,"pl-pds"],[664,669,"pl-s"],[664,665,"pl-pds"],[668,669,"pl-pds"],[673,677,"pl-s"],[673,674,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,23,"pl-s"],[0,23,"pl-s"],[2,23,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,89,"pl-s"],[0,89,"pl-s"],[34,37,"pl-k"],[59,64,"pl-k"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,90,"pl-s"],[89,90,"pl-pds"],[99,216,"pl-s"],[99,100,"pl-pds"],[215,216,"pl-pds"],[349,405,"pl-s"],[349,350,"pl-pds"],[404,405,"pl-pds"],[416,421,"pl-s"],[416,417,"pl-pds"],[420,421,"pl-pds"],[438,442,"pl-s"],[438,439,"pl-pds"],[441,442,"pl-pds"],[458,463,"pl-s"],[458,459,"pl-pds"],[462,463,"pl-pds"],[471,490,"pl-s"],[471,472,"pl-pds"],[489,490,"pl-pds"],[513,519,"pl-s"],[513,514,"pl-pds"],[518,519,"pl-pds"],[568,571,"pl-s"],[568,569,"pl-pds"],[570,571,"pl-pds"],[595,600,"pl-s"],[595,596,"pl-pds"],[599,600,"pl-pds"],[611,617,"pl-s"],[611,612,"pl-pds"],[616,617,"pl-pds"],[666,669,"pl-s"],[666,667,"pl-pds"],[668,669,"pl-pds"],[689,694,"pl-s"],[689,690,"pl-pds"],[693,694,"pl-pds"],[706,712,"pl-s"],[706,707,"pl-pds"],[711,712,"pl-pds"],[721,724,"pl-s"],[721,722,"pl-pds"],[723,724,"pl-pds"],[732,737,"pl-s"],[732,733,"pl-pds"],[736,737,"pl-pds"],[742,758,"pl-s"],[742,743,"pl-pds"],[757,758,"pl-pds"],[765,770,"pl-s"],[765,766,"pl-pds"],[769,770,"pl-pds"],[774,778,"pl-s"],[774,775,"pl-pds"],[777,778,"pl-pds"],[782,786,"pl-s"],[782,783,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,19,"pl-s"],[0,19,"pl-s"],[2,19,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,73,"pl-s"],[0,73,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,100,"pl-s"],[99,100,"pl-pds"],[106,124,"pl-s"],[106,107,"pl-pds"],[123,124,"pl-pds"],[148,166,"pl-s"],[148,149,"pl-pds"],[165,166,"pl-pds"],[203,204,"pl-s"],[203,204,"pl-pds"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,15,"pl-s"],[0,15,"pl-s"],[2,15,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,117,"pl-s"],[0,56,"pl-s"],[43,46,"pl-k"],[55,56,"pl-pds"],[116,117,"pl-s"],[116,117,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,26,"pl-s"],[0,26,"pl-s"],[2,26,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,70,"pl-s"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,25,"pl-s"],[0,25,"pl-s"],[2,25,"pl-c"],[2,3,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,9,"pl-s"],[0,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,75,"pl-s"]],[[0,5,"pl-s"],[2,5,"pl-s"],[2,3,"pl-pds"],[3,4,"pl-pds"],[4,5,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,41,"pl-s"],[0,41,"pl-s"],[0,41,"pl-c"],[0,1,"pl-c"]],[[0,86,"pl-s"],[0,86,"pl-s"],[19,22,"pl-k"]],[[0,7,"pl-s"],[0,3,"pl-s"],[0,1,"pl-pds"],[1,2,"pl-pds"],[2,3,"pl-pds"]],[[0,24,"pl-s"]],[[0,16,"pl-s"]],[[0,28,"pl-s"]],[[0,100,"pl-s"],[31,40,"pl-smi"],[48,53,"pl-smi"],[64,75,"pl-smi"],[99,100,"pl-pds"]],[[0,6,"pl-k"],[24,26,"pl-s"],[24,25,"pl-pds"],[25,26,"pl-pds"]],[],[[0,2,"pl-c1"]],[],[],[[13,14,"pl-c1"]],[[118,119,"pl-s"],[118,119,"pl-pds"]],[[0,3,"pl-s"],[0,3,"pl-s"],[0,1,"pl-pds"],[1,2,"pl-pds"],[2,3,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,28,"pl-s"],[0,28,"pl-s"],[0,28,"pl-c"],[0,1,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,296,"pl-s"],[0,296,"pl-s"],[130,132,"pl-k"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,13,"pl-s"],[0,13,"pl-s"],[0,13,"pl-c"],[0,1,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,181,"pl-s"],[0,181,"pl-s"],[37,40,"pl-k"],[41,140,"pl-smi"],[141,143,"pl-k"],[144,151,"pl-s"],[144,145,"pl-pds"],[150,151,"pl-pds"],[156,180,"pl-s"],[156,157,"pl-pds"],[179,180,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,29,"pl-s"],[0,29,"pl-s"]],[[0,7,"pl-s"],[0,7,"pl-s"],[0,7,"pl-s"],[0,1,"pl-pds"],[1,2,"pl-pds"],[2,3,"pl-pds"]],[[0,16,"pl-s"],[0,16,"pl-s"],[0,16,"pl-s"]],[[0,3,"pl-s"],[0,3,"pl-s"],[0,3,"pl-s"],[0,1,"pl-pds"],[1,2,"pl-pds"],[2,3,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,20,"pl-s"],[0,20,"pl-s"],[0,20,"pl-c"],[0,1,"pl-c"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,169,"pl-s"],[0,169,"pl-s"],[110,117,"pl-s"],[110,111,"pl-pds"],[116,117,"pl-pds"],[119,125,"pl-s"],[119,120,"pl-pds"],[124,125,"pl-pds"],[127,135,"pl-s"],[127,128,"pl-pds"],[134,135,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"]],[[0,219,"pl-s"],[0,219,"pl-s"],[0,1,"pl-k"],[2,4,"pl-k"],[14,16,"pl-k"],[35,37,"pl-k"],[76,95,"pl-s"],[76,77,"pl-pds"],[94,95,"pl-pds"],[132,152,"pl-s"],[132,133,"pl-pds"],[151,152,"pl-pds"],[193,219,"pl-s"],[193,194,"pl-pds"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,7,"pl-s"],[0,7,"pl-s"],[0,7,"pl-s"]],[[0,44,"pl-s"],[0,44,"pl-s"],[0,44,"pl-s"]],[[0,34,"pl-s"],[0,34,"pl-s"],[0,34,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,50,"pl-s"],[0,50,"pl-s"],[0,50,"pl-s"]],[[0,22,"pl-s"],[0,22,"pl-s"],[0,22,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,33,"pl-s"],[0,33,"pl-s"],[0,33,"pl-s"]],[[0,18,"pl-s"],[0,18,"pl-s"],[0,18,"pl-s"]],[[0,3,"pl-s"],[0,3,"pl-s"],[0,3,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,96,"pl-s"],[0,96,"pl-s"],[0,96,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,89,"pl-s"],[0,89,"pl-s"],[0,89,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,7,"pl-s"],[0,7,"pl-s"],[0,7,"pl-s"]],[[0,26,"pl-s"],[0,26,"pl-s"],[0,26,"pl-s"]],[[0,3,"pl-s"],[0,3,"pl-s"],[0,3,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,14,"pl-s"],[0,14,"pl-s"],[0,14,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,151,"pl-s"],[0,151,"pl-s"],[0,151,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,7,"pl-s"],[0,7,"pl-s"],[0,7,"pl-s"]],[[0,18,"pl-s"],[0,18,"pl-s"],[0,18,"pl-s"]],[[0,3,"pl-s"],[0,3,"pl-s"],[0,3,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,110,"pl-s"],[0,110,"pl-s"],[0,110,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,115,"pl-s"],[0,115,"pl-s"],[0,115,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,12,"pl-s"],[0,12,"pl-s"],[0,12,"pl-s"]],[[0,130,"pl-s"],[0,130,"pl-s"],[0,130,"pl-s"]],[[0,0,"pl-s"],[0,0,"pl-s"],[0,0,"pl-s"]],[[0,10,"pl-s"],[0,10,"pl-s"],[0,10,"pl-s"]],[[0,118,"pl-s"],[0,118,"pl-s"],[0,118,"pl-s"]]],"colorizedLines":null}},"title":"maxdiffusion/README.md at main · AI-Hypercomputer/maxdiffusion","appPayload":{},"meta":{"title":"maxdiffusion/README.md at main · AI-Hypercomputer/maxdiffusion"}}</script>
  <div data-target="react-app.reactRoot"><meta name="github-code-view-meta-stats" id="github-code-view-meta-stats" data-hydrostats="publish"/> <!-- --> <a hidden="" id="code-view-repo-link" href="/AI-Hypercomputer/maxdiffusion" data-discover="true"></a> <div class="d-none"></div><div><div style="--spacing:var(--spacing-none)" class="prc-PageLayout-PageLayoutRoot--KH-d" data-component="SplitPageLayout" data-has-sidebar="true"><div class="prc-PageLayout-SidebarWrapper-kLG4B CopilotSidePanelSidebar-module__SidePanel__L3O0C CopilotSidePanelSidebar-module__HiddenSidePanel__TBRGn" style="--spacing-column:var(--spacing-none)" data-is-hidden="false" data-position="end" data-sticky="true" data-responsive-variant="fullscreen"><div class="prc-PageLayout-VerticalDivider-9QRmK prc-PageLayout-SidebarVerticalDivider-0Rl0V" data-component="PageLayout.VerticalDivider" data-variant="line" data-position="end" style="--spacing:var(--spacing-none)"><div class="prc-PageLayout-DraggableHandle-9s6B4" data-component="PageLayout.DragHandle" role="slider" aria-label="Draggable pane splitter" aria-valuemin="450" aria-valuemax="768" aria-valuenow="544" aria-valuetext="Pane width 544 pixels" tabindex="0"></div></div><div class="prc-PageLayout-Sidebar-iciWg" data-component="SplitPageLayout.Sidebar" data-resizable="true" style="--spacing:var(--spacing-normal);--pane-min-width:450px;--pane-max-width:768px;--pane-width-custom:544px;--pane-width-size:var(--pane-width-custom);--pane-width:544px"><div class="height-full" data-testid="copilot-code-view-side-panel"><div id="copilot-side-panel-content" class="height-full"></div></div></div></div><div class="prc-PageLayout-PageLayoutWrapper-2BhU2" data-width="full"><div class="prc-PageLayout-PageLayoutContent-BneH9"><div id="repos-file-tree-sidebar" class="CodeViewFileTreeLayout-module__sidebar__n_Aau" tabindex="0"><div class="prc-PageLayout-PaneWrapper-pHPop ReposFileTreePane-module__Pane__rBZpI ReposFileTreePane-module__HideTree__AYZnm ReposFileTreePane-module__HidePane__VHAVt" style="--offset-header:0px;--spacing-row:var(--spacing-none);--spacing-column:var(--spacing-none)" data-is-hidden="false" data-position="start" data-sticky="true"><div class="prc-PageLayout-HorizontalDivider-JLVqp prc-PageLayout-PaneHorizontalDivider-9tbnE" data-component="PageLayout.HorizontalDivider" data-variant-regular="none" data-variant-narrow="none" data-position="start" style="--spacing-divider:var(--spacing-none);--spacing:var(--spacing-none)"></div><div class="prc-PageLayout-Pane-AyzHK" data-component="SplitPageLayout.Pane" data-resizable="true" style="--spacing:var(--spacing-none);--pane-min-width:256px;--pane-max-width:calc(100vw - var(--pane-max-width-diff));--pane-width-size:var(--pane-width-large);--pane-width:320px"></div><div class="prc-PageLayout-VerticalDivider-9QRmK prc-PageLayout-PaneVerticalDivider-le57g" data-component="PageLayout.VerticalDivider" data-variant-narrow="none" data-variant-regular="line" data-variant-wide="line" data-position="start" style="--spacing:var(--spacing-none)"><div class="prc-PageLayout-DraggableHandle-9s6B4" data-component="PageLayout.DragHandle" role="slider" aria-label="Draggable pane splitter" aria-valuemin="256" aria-valuemax="600" aria-valuenow="320" aria-valuetext="Pane width 320 pixels" tabindex="0"></div></div></div></div><div data-component="SplitPageLayout.Content" class="prc-PageLayout-ContentWrapper-gR9eG"><div class="prc-PageLayout-Content-xWL-A" data-width="full" style="--spacing:var(--spacing-none)"><div class="SharedPageLayout-module__content__IwGAp" data-selector="repos-split-pane-content" id="repos-split-pane-content" tabindex="0"> <!-- --> <div class="container CodeViewHeader-module__Box__JkPOb"><div class="CodeViewHeader-module__StickyHeader__Qn7UN" id="StickyHeader"><div class="CodeViewHeader-module__Box_1__SbNDV"><div class="CodeViewHeader-module__Box_2__TB46f"><div class="react-code-view-header-wrap--narrow CodeViewHeader-module__Box_3__q1zUL"><div class="CodeViewHeader-module__treeToggleWrapper__RQ__9"><h2 class="use-tree-pane-module__Heading__s4QbZ prc-Heading-Heading-MtWFE" data-component="Heading"><button data-component="Button" type="button" aria-label="Expand file tree" data-testid="expand-file-tree-button-mobile" class="prc-Button-ButtonBase-9n-Xk ExpandFileTreeButton-module__Button_1__Svs95" data-loading="false" data-size="medium" data-variant="invisible"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-arrow-left" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z"></path></svg></span><span data-component="text" class="prc-Button-Label-FWkx3">Files</span></span></button><button data-component="IconButton" type="button" data-testid="expand-file-tree-button" aria-controls="repos-file-tree" class="prc-Button-ButtonBase-9n-Xk position-relative ExpandFileTreeButton-module__expandButton__hDOcv ExpandFileTreeButton-module__filesButtonBreakpoint__zEvz3 fgColor-muted prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-labelledby="_R_4lla9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-sidebar-collapse" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M6.823 7.823a.25.25 0 0 1 0 .354l-2.396 2.396A.25.25 0 0 1 4 10.396V5.604a.25.25 0 0 1 .427-.177Z"></path><path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25H9.5v-13H1.75a.25.25 0 0 0-.25.25ZM11 14.5h3.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H11Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="se" data-component="Tooltip" aria-hidden="true" id="_R_4lla9lik5_">Expand file tree</span><div class="d-none"></div></h2></div><div class="react-code-view-header-mb--narrow mr-2"><button data-component="Button" type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="main branch" data-testid="anchor-button" data-icv-name="Switch branches/tags" class="prc-Button-ButtonBase-9n-Xk ref-selector-class RefSelectorAnchoredOverlay-module__RefSelectorOverlayBtn__a3WK3" data-loading="false" data-size="medium" data-variant="default" id="ref-picker-repos-header-ref-selector-wide"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></span><span data-component="text" class="prc-Button-Label-FWkx3"><div class="RefSelectorAnchoredOverlay-module__RefSelectorOverlayContainer__yaf4p"><div style="max-width:125px" class="ref-selector-button-text-container RefSelectorAnchoredOverlay-module__RefSelectorBtnTextContainer__Di3rk"><span class="RefSelectorAnchoredOverlay-module__RefSelectorText__w_fmP">main</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-YNt2F prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><div class="d-none"></div></div><div class="react-code-view-header-mb--narrow CodeViewHeader-module__Box_5__MQ0hL"><div class="Breadcrumb-module__container__Vxvev Breadcrumb-module__lg__Rjz0A"><nav data-testid="breadcrumbs" aria-labelledby="repos-header-breadcrumb-heading" id="repos-header-breadcrumb" class="Breadcrumb-module__nav__rQFDj"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone__rwWIk prc-Heading-Heading-MtWFE" data-component="Heading" data-testid="screen-reader-heading" id="repos-header-breadcrumb-heading">Breadcrumbs</h2><ol class="Breadcrumb-module__list__ZH6zr"><li class="Breadcrumb-module__listItem__Ib0x_"><a class="Breadcrumb-module__repoLink__O2Nbs prc-Link-Link-9ZwDx" data-component="Link" data-testid="breadcrumbs-repo-link" href="/AI-Hypercomputer/maxdiffusion/tree/main" data-discover="true">maxdiffusion</a></li></ol></nav><div data-testid="breadcrumbs-filename" class="Breadcrumb-module__filename__equZR"><span class="Breadcrumb-module__separator__eNwsI Breadcrumb-module__lg__Rjz0A" aria-hidden="true">/</span><h1 class="Breadcrumb-module__filenameHeading__MNMtw Breadcrumb-module__lg__Rjz0A prc-Heading-Heading-MtWFE" data-component="Heading" tabindex="-1" id="file-name-id">README.md</h1></div><button data-component="IconButton" type="button" class="prc-Button-ButtonBase-9n-Xk ml-2 prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_7lla9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><span class="CopyToClipboardIconButton-module__tooltip__WyiwL prc-TooltipV2-Tooltip-tLeuB" data-direction="nw" data-component="Tooltip" aria-label="Copy path" aria-hidden="true" id="_R_7lla9lik5_">Copy path</span></div></div></div><div class="react-code-view-header-element--wide"><div class="CodeViewHeader-module__Box_7___0R6c"><div class="d-flex gap-2"><div><div class="CodeViewHeader-module__FileResultsList__JDzUy"><span class="d-flex FileResultsList-module__FilesSearchBox__ivVkc TextInput-wrapper prc-components-TextInputWrapper-Hpdqi prc-components-TextInputBaseWrapper-wY-n0" data-no-trailing-action="true" data-component="TextInput" data-leading-visual="true" data-trailing-visual="true" aria-busy="false"><span class="TextInput-icon" id="_R_5ipla9lik5_" aria-hidden="true" data-component="TextInput.LeadingVisual"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span><input type="text" aria-label="Go to file" role="combobox" aria-controls="file-results-list" aria-expanded="false" aria-haspopup="dialog" autoCorrect="off" spellCheck="false" placeholder="Go to file" aria-describedby="_R_5ipla9lik5_ _R_5ipla9lik5H1_" data-component="input" class="prc-components-Input-IwWrt" value=""/><span class="TextInput-icon" id="_R_5ipla9lik5H1_" aria-hidden="true" data-component="TextInput.TrailingVisual"></span></span></div><div class="d-none"></div></div><button data-component="Button" type="button" style="display:none" class="prc-Button-ButtonBase-9n-Xk NavigationMenu-module__Button__LpKgm" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="text" class="prc-Button-Label-FWkx3">Blame</span></span></button><div class="d-none"></div><button data-component="IconButton" type="button" data-testid="more-file-actions-button-nav-menu-wide" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk js-blob-dropdown-click NavigationMenu-module__IconButton__HpX3G prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_v4pla9lik5_" id="_R_14pla9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="nw" data-component="Tooltip" aria-hidden="true" id="_R_v4pla9lik5_">More file actions</span></div></div></div><div class="react-code-view-header-element--narrow"><div class="CodeViewHeader-module__Box_7___0R6c"><div class="d-flex gap-2"><button data-component="Button" type="button" style="display:none" class="prc-Button-ButtonBase-9n-Xk NavigationMenu-module__Button__LpKgm" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="text" class="prc-Button-Label-FWkx3">Blame</span></span></button><div class="d-none"></div><button data-component="IconButton" type="button" data-testid="more-file-actions-button-nav-menu-narrow" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk js-blob-dropdown-click NavigationMenu-module__IconButton__HpX3G prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_v4tla9lik5_" id="_R_14tla9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="nw" data-component="Tooltip" aria-hidden="true" id="_R_v4tla9lik5_">More file actions</span></div></div></div></div></div></div></div><div class="CodeView-module__contentWrapper__cG2JH"><div class="react-code-view-bottom-padding"><div class="BlobTopBanners-module__Box__v_nvx"></div></div> <div class="d-none"></div><div class="d-flex flex-column border rounded-2 tmp-mb-3 pl-1"><div class="LatestCommit-module__Box__B25ZT"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone__rwWIk prc-Heading-Heading-MtWFE" data-component="Heading" data-testid="screen-reader-heading">Latest commit</h2><div style="width:120px" class="Skeleton Skeleton--text" data-testid="loading"> </div><div class="d-flex flex-shrink-0 gap-2"><div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center"></div><div class="d-flex gap-2"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone__rwWIk prc-Heading-Heading-MtWFE" data-component="Heading" data-testid="screen-reader-heading">History</h2><a data-component="LinkButton" href="/AI-Hypercomputer/maxdiffusion/commits/main/README.md" class="prc-Button-ButtonBase-9n-Xk d-none d-lg-flex LinkButton-module__linkButton__nFnov flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span><span data-component="text" class="prc-Button-Label-FWkx3"><span class="fgColor-default">History</span></span></span></a><div class="d-sm-none"></div><div class="d-flex d-lg-none"><a data-component="LinkButton" aria-label="View commit history for this file." href="/AI-Hypercomputer/maxdiffusion/commits/main/README.md" class="prc-Button-ButtonBase-9n-Xk LinkButton-module__linkButton__nFnov flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby="_R_4mlala9lik5_"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span></span></a><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" data-component="Tooltip" role="tooltip" aria-hidden="true" id="_R_4mlala9lik5_">History</span></div></div></div></div></div><div class="d-flex flex-row"><div class="container BlobViewContent-module__blobContainer__DtH2d"><div class="react-code-size-details-banner BlobViewContent-module__codeSizeDetails__e5sUw"><div class="react-code-size-details-banner CodeSizeDetails-module__Box__VcD6l"><div class="text-mono CodeSizeDetails-module__Box_1__GVxQL"><div class="CodeSizeDetails-module__Truncate__Ttm43 prc-Truncate-Truncate-2G1eo" data-inline="true" title="executable file" style="--truncate-max-width:125px"><span>executable file</span></div><span class="CodeSizeDetails-module__Text__k8GnB">·</span><div data-testid="blob-size" class="CodeSizeDetails-module__Truncate_1__lE93V prc-Truncate-Truncate-2G1eo" data-inline="true" title="46.2 KB" style="--truncate-max-width:100%"><span>969 lines (750 loc) · 46.2 KB</span></div></div></div></div><div class="react-blob-view-header-sticky BlobViewContent-module__stickyHeader__VwxB5" id="repos-sticky-header"><div class="BlobViewHeader-module__Box__yhm9u"><div class="react-blob-sticky-header"><div class="FileNameStickyHeader-module__outerWrapper__ZL4Xc FileNameStickyHeader-module__outerWrapperHidden__Zpynk"><div class="FileNameStickyHeader-module__Box_1__Hazu5"><div class="FileNameStickyHeader-module__Box_2__hoolP"><div class="FileNameStickyHeader-module__Box_3__MVKsk"><button data-component="Button" type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="main branch" data-testid="anchor-button" data-icv-name="Switch branches/tags" class="prc-Button-ButtonBase-9n-Xk ref-selector-class RefSelectorAnchoredOverlay-module__RefSelectorOverlayBtn__a3WK3" data-loading="false" data-size="medium" data-variant="default" id="ref-picker-repos-header-ref-selector"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></span><span data-component="text" class="prc-Button-Label-FWkx3"><div class="RefSelectorAnchoredOverlay-module__RefSelectorOverlayContainer__yaf4p"><div style="max-width:125px" class="ref-selector-button-text-container RefSelectorAnchoredOverlay-module__RefSelectorBtnTextContainer__Di3rk"><span class="RefSelectorAnchoredOverlay-module__RefSelectorText__w_fmP">main</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-YNt2F prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><div class="d-none"></div></div><div class="FileNameStickyHeader-module__Box_4__FLhtt"><div class="Breadcrumb-module__container__Vxvev Breadcrumb-module__md__Wb1Gs"><nav data-testid="breadcrumbs" aria-labelledby="sticky-breadcrumb-heading" id="sticky-breadcrumb" class="Breadcrumb-module__nav__rQFDj"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone__rwWIk prc-Heading-Heading-MtWFE" data-component="Heading" data-testid="screen-reader-heading" id="sticky-breadcrumb-heading">Breadcrumbs</h2><ol class="Breadcrumb-module__list__ZH6zr"><li class="Breadcrumb-module__listItem__Ib0x_"><a class="Breadcrumb-module__repoLink__O2Nbs prc-Link-Link-9ZwDx" data-component="Link" data-testid="breadcrumbs-repo-link" href="/AI-Hypercomputer/maxdiffusion/tree/main" data-discover="true">maxdiffusion</a></li></ol></nav><div data-testid="breadcrumbs-filename" class="Breadcrumb-module__filename__equZR"><span class="Breadcrumb-module__separator__eNwsI Breadcrumb-module__md__Wb1Gs" aria-hidden="true">/</span><h1 class="Breadcrumb-module__filenameHeading__MNMtw Breadcrumb-module__md__Wb1Gs prc-Heading-Heading-MtWFE" data-component="Heading" tabindex="-1" id="sticky-file-name-id">README.md</h1></div><button data-component="IconButton" type="button" class="prc-Button-ButtonBase-9n-Xk ml-2 prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_7lcpala9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><span class="CopyToClipboardIconButton-module__tooltip__WyiwL prc-TooltipV2-Tooltip-tLeuB" data-direction="s" data-component="Tooltip" aria-label="Copy path" aria-hidden="true" id="_R_7lcpala9lik5_">Copy path</span></div></div></div><button data-component="Button" type="button" class="prc-Button-ButtonBase-9n-Xk FileNameStickyHeader-module__Button__LSEU_ FileNameStickyHeader-module__GoToTopButton__nxAFn" data-loading="false" data-size="small" data-variant="invisible"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="leadingVisual" class="prc-Button-Visual-YNt2F prc-Button-LeadingVisual-UySKu prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-arrow-up" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.47 7.78a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018L9 4.81v7.44a.75.75 0 0 1-1.5 0V4.81L4.53 7.78a.75.75 0 0 1-1.06 0Z"></path></svg></span><span data-component="text" class="prc-Button-Label-FWkx3">Top</span></span></button></div></div></div><div class="BlobViewHeader-module__Box_1__VEmuQ"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone__rwWIk prc-Heading-Heading-MtWFE" data-component="Heading" data-testid="screen-reader-heading">File metadata and controls</h2><div class="BlobViewHeader-module__Box_2__icUs2"><ul aria-label="File view" class="prc-SegmentedControl-SegmentedControl-lqIXp BlobTabButtons-module__SegmentedControl__jen2u" data-variant="default" data-size="small" data-component="SegmentedControl"><li class="prc-SegmentedControl-Item-tSCQh" data-selected="" data-component="SegmentedControl.Button"><button aria-pressed="true" class="prc-SegmentedControl-Button-E48xz" type="button" style="--separator-color:transparent"><span class="prc-SegmentedControl-Content-1COlk segmentedControl-content"><div class="prc-SegmentedControl-Text-7S2y2 segmentedControl-text" data-text="Preview">Preview</div></span></button></li><li class="prc-SegmentedControl-Item-tSCQh" data-component="SegmentedControl.Button"><button aria-pressed="false" class="prc-SegmentedControl-Button-E48xz" type="button" style="--separator-color:var(--borderColor-default)"><span class="prc-SegmentedControl-Content-1COlk segmentedControl-content"><div class="prc-SegmentedControl-Text-7S2y2 segmentedControl-text" data-text="Code">Code</div></span></button></li><li class="prc-SegmentedControl-Item-tSCQh" data-component="SegmentedControl.Button"><button aria-pressed="false" class="prc-SegmentedControl-Button-E48xz" type="button" style="--separator-color:var(--borderColor-default)"><span class="prc-SegmentedControl-Content-1COlk segmentedControl-content"><div class="prc-SegmentedControl-Text-7S2y2 segmentedControl-text" data-text="Blame">Blame</div></span></button></li></ul><div class="d-none"></div><div class="react-code-size-details-in-header CodeSizeDetails-module__Box__VcD6l"><div class="text-mono CodeSizeDetails-module__Box_1__GVxQL"><div class="CodeSizeDetails-module__Truncate__Ttm43 prc-Truncate-Truncate-2G1eo" data-inline="true" title="executable file" style="--truncate-max-width:125px"><span>executable file</span></div><span class="CodeSizeDetails-module__Text__k8GnB">·</span><div data-testid="blob-size" class="CodeSizeDetails-module__Truncate_1__lE93V prc-Truncate-Truncate-2G1eo" data-inline="true" title="46.2 KB" style="--truncate-max-width:100%"><span>969 lines (750 loc) · 46.2 KB</span></div></div></div></div><div class="BlobViewHeader-module__Box_3__ng6v2"><div class="d-none"></div><div class="react-blob-header-edit-and-raw-actions BlobViewHeader-module__Box_4__J4Y4W"><div class="d-none"></div><div class="prc-ButtonGroup-ButtonGroup-vFUrY" data-component="ButtonGroup"><div class="prc-ButtonGroup-Item-PqvDl"><a data-component="LinkButton" href="https://github.com/AI-Hypercomputer/maxdiffusion/raw/refs/heads/main/README.md" data-testid="raw-button" class="prc-Button-ButtonBase-9n-Xk LinkButton-module__linkButton__nFnov BlobViewHeader-module__LinkButton__X9kx2" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="text" class="prc-Button-Label-FWkx3">Raw</span></span></a></div><div class="prc-ButtonGroup-Item-PqvDl"><button data-component="IconButton" type="button" data-testid="copy-raw-button" class="prc-Button-ButtonBase-9n-Xk prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default" aria-labelledby="_R_qaucpala9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="n" data-component="Tooltip" aria-hidden="true" id="_R_qaucpala9lik5_">Copy raw file</span></div><div class="prc-ButtonGroup-Item-PqvDl"><button data-component="IconButton" type="button" data-testid="download-raw-button" class="prc-Button-ButtonBase-9n-Xk BlobViewHeader-module__downloadButton__ef459 prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default" aria-labelledby="_R_eaucpala9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-download" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"></path><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="n" data-component="Tooltip" aria-hidden="true" id="_R_eaucpala9lik5_">Download raw file</span></div></div></div><button data-component="IconButton" type="button" aria-pressed="false" class="prc-Button-ButtonBase-9n-Xk tmp-mr-2 TableOfContents-module__IconButton__jrlNM prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_3ucpala9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-list-unordered" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="n" data-component="Tooltip" aria-hidden="true" id="_R_3ucpala9lik5_">Outline</span><div class="react-blob-header-edit-and-raw-actions-combined"><button data-component="IconButton" type="button" title="More file actions" data-testid="more-file-actions-button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk js-blob-dropdown-click BlobViewHeader-module__IconButton__XrMQY prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_fkecpala9lik5_" id="_R_kecpala9lik5_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="nw" data-component="Tooltip" aria-hidden="true" id="_R_fkecpala9lik5_">Edit and raw actions</span></div></div></div></div><div></div></div><div class="BlobViewContent-module__blobContentWrapper__JS0W6"><section aria-labelledby="file-name-id-wide file-name-id-mobile" class="BlobContent-module__blobContentSection__VOgZq BlobContent-module__blobContentSectionMarkdown__mPLOK" style="margin-top:46px"><div class="js-snippet-clipboard-copy-unpositioned BlobContent-module__markdownBlob__T8jpG" data-hpc="true" containertiming="hpc"><article class="markdown-body entry-content container-lg" itemprop="text">
<p dir="auto"><a href="https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml"><img src="https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml/badge.svg" alt="Unit Tests" style="max-width: 100%;"></a></p>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">What's new?</h1><a id="user-content-whats-new" class="anchor" aria-label="Permalink: What's new?" href="#whats-new"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<ul dir="auto">
<li><strong><code>2026/08/28</code></strong>: Flux2.Klein text to image and image editing (w/ KV Cache) is now supported.</li>
<li><strong><code>2026/07/14</code></strong>: Automatic attention tile-size (<code>block_q</code>/<code>block_kv</code>) search for Wan is now supported.</li>
<li><strong><code>2026/06/26</code></strong>: 2D ring (USP) attention with a custom splash kernel is now supported for Wan (<code>ulysses_ring_custom</code>), splitting context parallelism into an intra-chip Ulysses axis and a cross-chip ring axis.</li>
<li><strong><code>2026/04/16</code></strong>: Support for Tokamax Ring Attention kernel is now added.</li>
<li><strong><code>2026/03/31</code></strong>: Wan2.2 SenCache inference is now supported for T2V and I2V (up to 1.4x speedup)</li>
<li><strong><code>2026/03/25</code></strong>: Wan2.1 and Wan2.2 Magcache inference is now supported</li>
<li><strong><code>2026/03/25</code></strong>: LTX-2 Video Inference is now supported</li>
<li><strong><code>2026/01/29</code></strong>: Wan LoRA for inference is now supported</li>
<li><strong><code>2026/01/15</code></strong>: Wan2.1 and Wan2.2 Img2vid generation is now supported</li>
<li><strong><code>2025/11/11</code></strong>: Wan2.2 txt2vid generation is now supported</li>
<li><strong><code>2025/10/10</code></strong>: Wan2.1 txt2vid training and generation is now supported.</li>
<li><strong><code>2025/10/14</code></strong>: NVIDIA DGX Spark Flux support.</li>
<li><strong><code>2025/08/14</code></strong>: LTX-Video img2vid generation is now supported.</li>
<li><strong><code>2025/07/29</code></strong>: LTX-Video text2vid generation is now supported.</li>
<li><strong><code>2025/04/17</code></strong>: Flux Finetuning.</li>
<li><strong><code>2025/02/12</code></strong>: Flux LoRA for inference.</li>
<li><strong><code>2025/02/08</code></strong>: Flux schnell &amp; dev inference.</li>
<li><strong><code>2024/12/12</code></strong>: Load multiple LoRAs for inference.</li>
<li><strong><code>2024/10/22</code></strong>: LoRA support for Hyper SDXL.</li>
<li><strong><code>2024/08/01</code></strong>: Orbax is the new default checkpointer. You can still use <code>pipeline.save_pretrained</code> after training to save in diffusers format.</li>
<li><strong><code>2024/07/20</code></strong>: Dreambooth training for Stable Diffusion 1.x,2.x is now supported.</li>
</ul>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Overview</h1><a id="user-content-overview" class="anchor" aria-label="Permalink: Overview" href="#overview"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">MaxDiffusion is a collection of reference implementations of various latent diffusion models written in pure Python/Jax that run on XLA devices including Cloud TPUs and GPUs. MaxDiffusion aims to be a launching off point for ambitious Diffusion projects both in research and production. We encourage you to start by experimenting with MaxDiffusion out of the box and then fork and modify MaxDiffusion to meet your needs.</p>
<p dir="auto">The goal of this project is to provide reference implementations for latent diffusion models that help developers get started with training, tuning, and serving solutions on XLA devices including Cloud TPUs and GPUs. We started with Stable Diffusion inference on TPUs, but welcome code contributions to grow.</p>
<p dir="auto">MaxDiffusion supports</p>
<ul dir="auto">
<li>Stable Diffusion 2 base (inference)</li>
<li>Stable Diffusion 2.1 (training and inference)</li>
<li>Stable Diffusion XL (training and inference).</li>
<li>Flux Dev and Schnell (Training and inference).</li>
<li>Flux.2-Klein 4B &amp; 9B (text-to-image and multi-image editing with KV-Cache).</li>
<li>Stable Diffusion Lightning (inference).</li>
<li>Hyper-SD XL LoRA loading (inference).</li>
<li>Load Multiple LoRA (SDXL inference).</li>
<li>ControlNet inference (Stable Diffusion 1.4 &amp; SDXL).</li>
<li>Dreambooth training support for Stable Diffusion 1.x,2.x.</li>
<li>LTX-Video text2vid, img2vid (inference).</li>
<li>LTX-2 Video text2vid (inference).</li>
<li>Wan2.1 text2vid (training and inference).</li>
<li>Wan2.2 text2vid (inference).</li>
</ul>
<p dir="auto"><strong>Note on GPU Support:</strong> GPU support is not actively maintained, but contributions are welcome</p>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Table of Contents</h1><a id="user-content-table-of-contents" class="anchor" aria-label="Permalink: Table of Contents" href="#table-of-contents"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<ul dir="auto">
<li><a href="#whats-new">What's new?</a></li>
<li><a href="#overview">Overview</a></li>
<li><a href="#table-of-contents">Table of Contents</a></li>
<li><a href="#getting-started">Getting Started</a>
<ul dir="auto">
<li><a href="#getting-started-1">Getting Started:</a></li>
<li><a href="#nvidia-dgx-spark">NVIDIA DGX Spark</a></li>
<li><a href="#training">Training</a>
<ul dir="auto">
<li><a href="#wan-21-training">Wan2.1</a></li>
<li><a href="#flux-training">Flux</a></li>
<li><a href="#stable-diffusion-xl-training">SDXL</a></li>
<li><a href="#stable-diffusion-2-base-training">SD 2 base</a></li>
<li><a href="#stable-diffusion-14-training">SD 1.4</a></li>
<li><a href="#dreambooth">Dreambooth</a></li>
</ul>
</li>
<li><a href="#inference">Inference</a>
<ul dir="auto">
<li><a href="#wan-models">Wan</a></li>
<li><a href="#ltx-video">LTX-Video</a></li>
<li><a href="#ltx-2-video">LTX-2 Video</a></li>
<li><a href="#flux">Flux</a>
<ul dir="auto">
<li><a href="#fused-attention-for-gpu">Fused Attention for GPU</a></li>
</ul>
</li>
<li><a href="#stable-diffusion-xl">SDXL</a></li>
<li><a href="#stable-diffusion-2-base">SD 2 base</a></li>
<li><a href="#stable-diffusion-21">SD 2.1</a></li>
<li><a href="#wan-lora">Wan LoRA</a></li>
<li><a href="#flux-lora">Flux LoRA</a></li>
<li><a href="#hyper-sdxl-lora">Hyper SDXL LoRA</a></li>
<li><a href="#load-multiple-lora">Load Multiple LoRA</a></li>
<li><a href="#sdxl-lightning">SDXL Lightning</a></li>
<li><a href="#controlnet">ControlNet</a></li>
</ul>
</li>
<li><a href="#getting-started-multihost-development">Getting Started: Multihost development</a></li>
</ul>
</li>
<li><a href="#comparison-to-alternatives">Comparison to Alternatives</a></li>
<li><a href="#development">Development</a>
<ul dir="auto">
<li><a href="#profiling">Profiling</a></li>
<li><a href="#metrics">Metrics</a></li>
</ul>
</li>
</ul>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Getting Started</h1><a id="user-content-getting-started" class="anchor" aria-label="Permalink: Getting Started" href="#getting-started"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">We recommend starting with a single TPU host and then moving to multihost.</p>
<p dir="auto">Minimum requirements: Ubuntu Version 22.04, Python 3.12 and Tensorflow &gt;= 2.12.0.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Getting Started:</h2><a id="user-content-getting-started-1" class="anchor" aria-label="Permalink: Getting Started:" href="#getting-started-1"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">For your first time running Maxdiffusion, we provide specific <a href="/AI-Hypercomputer/maxdiffusion/blob/main/docs/getting_started/first_run.md">instructions</a>.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">NVIDIA DGX Spark</h2><a id="user-content-nvidia-dgx-spark" class="anchor" aria-label="Permalink: NVIDIA DGX Spark" href="#nvidia-dgx-spark"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Try out MaxDiffusion on NVIDIA's DGX Spark. We provide specific <a href="/AI-Hypercomputer/maxdiffusion/blob/main/docs/dgx_spark.md">instructions</a>.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Training</h2><a id="user-content-training" class="anchor" aria-label="Permalink: Training" href="#training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">After installation completes, run the training script.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Wan 2.1 Training</h2><a id="user-content-wan-21-training" class="anchor" aria-label="Permalink: Wan 2.1 Training" href="#wan-21-training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">in the first part, we'll run on a single host VM to get familiar with the workflow, then run on xpk for large scale training.</p>
<p dir="auto">Although not required, attaching an external disk is recommended as weights take up a lot of disk space. <a href="https://cloud.google.com/tpu/docs/attach-durable-block-storage" rel="nofollow">Follow these instructions if you would like to attach an external disk</a>.</p>
<p dir="auto">This workflow was tested using v5p-8 with a 500GB disk attached.</p>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Dataset Preparation</h3><a id="user-content-dataset-preparation" class="anchor" aria-label="Permalink: Dataset Preparation" href="#dataset-preparation"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">For this example, we'll be using the <a href="https://huggingface.co/datasets/RaphaelLiu/PusaV1_training" rel="nofollow">PusaV1 dataset</a>.</p>
<p dir="auto">First, download the dataset.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export HF_DATASET_DIR=/mnt/disks/external_disk/PusaV1_training/
export TFRECORDS_DATASET_DIR=/mnt/disks/external_disk/wan_tfr_dataset_pusa_v1
huggingface-cli download RaphaelLiu/PusaV1_training --repo-type dataset --local-dir $HF_DATASET_DIR"><pre><span class="pl-k">export</span> HF_DATASET_DIR=/mnt/disks/external_disk/PusaV1_training/
<span class="pl-k">export</span> TFRECORDS_DATASET_DIR=/mnt/disks/external_disk/wan_tfr_dataset_pusa_v1
huggingface-cli download RaphaelLiu/PusaV1_training --repo-type dataset --local-dir <span class="pl-smi">$HF_DATASET_DIR</span></pre></div>
<p dir="auto">Next run the TFRecords conversion script. This step prepares training and eval datasets. Validation is done as described in  <a href="https://arxiv.org/pdf/2403.03206" rel="nofollow">Scaling Rectified Flow Transformers for High-Resolution Image Synthesis</a>. More details <a href="https://github.com/mlcommons/training/tree/master/text_to_image#5-quality">here</a></p>
<p dir="auto">Training dataset.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/train no_records_per_shard=10 enable_eval_timesteps=False"><pre>python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=<span class="pl-smi">$HF_DATASET_DIR</span> tfrecords_dir=<span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/train no_records_per_shard=10 enable_eval_timesteps=False</pre></div>
<p dir="auto">The script will not have an output, but you can check the progress using:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ls -ll $TFRECORDS_DATASET_DIR/train"><pre>ls -ll <span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/train</pre></div>
<p dir="auto">Evaluation dataset.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=$HF_DATASET_DIR tfrecords_dir=$TFRECORDS_DATASET_DIR/eval no_records_per_shard=10 enable_eval_timesteps=True"><pre>python src/maxdiffusion/data_preprocessing/wan_pusav1_to_tfrecords.py src/maxdiffusion/configs/base_wan_14b.yml train_data_dir=<span class="pl-smi">$HF_DATASET_DIR</span> tfrecords_dir=<span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/eval no_records_per_shard=10 enable_eval_timesteps=True</pre></div>
<p dir="auto">The evaluation dataset creation takes the first 420 samples of the dataset and adds a timestep field. We then need to manually delete the first 420 samples from the <code>train</code> folder so they are not used in training.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="printf &quot;%s\n&quot; $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 &lt;= 420' | xargs -d '\n' rm"><pre><span class="pl-c1">printf</span> <span class="pl-s"><span class="pl-pds">"</span>%s\n<span class="pl-pds">"</span></span> <span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/train/file_<span class="pl-k">*</span>-<span class="pl-k">*</span>.tfrec <span class="pl-k">|</span> awk -F <span class="pl-s"><span class="pl-pds">'</span>[-.]<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>$2+0 &lt;= 420<span class="pl-pds">'</span></span> <span class="pl-k">|</span> xargs -d <span class="pl-s"><span class="pl-pds">'</span>\n<span class="pl-pds">'</span></span> rm</pre></div>
<p dir="auto">And verify that they do not exist.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="printf &quot;%s\n&quot; $TFRECORDS_DATASET_DIR/train/file_*-*.tfrec | awk -F '[-.]' '$2+0 &lt;= 420' | xargs -d '\n' echo"><pre><span class="pl-c1">printf</span> <span class="pl-s"><span class="pl-pds">"</span>%s\n<span class="pl-pds">"</span></span> <span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/train/file_<span class="pl-k">*</span>-<span class="pl-k">*</span>.tfrec <span class="pl-k">|</span> awk -F <span class="pl-s"><span class="pl-pds">'</span>[-.]<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>$2+0 &lt;= 420<span class="pl-pds">'</span></span> <span class="pl-k">|</span> xargs -d <span class="pl-s"><span class="pl-pds">'</span>\n<span class="pl-pds">'</span></span> <span class="pl-c1">echo</span></pre></div>
<p dir="auto">After the script is done running, you should see the following directory structure inside <code>$TFRECORDS_DATASET_DIR</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="train
eval_timesteps"><pre class="notranslate"><code>train
eval_timesteps
</code></pre></div>
<p dir="auto">In some instances an empty file <code>file_42-430.tfrec</code> is created inside <code>eval_timesteps</code>, for sanity check, let's run a delete command.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="rm $TFRECORDS_DATASET_DIR/eval_timesteps/file_42-430.tfrec"><pre>rm <span class="pl-smi">$TFRECORDS_DATASET_DIR</span>/eval_timesteps/file_42-430.tfrec</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Training on a Single VM</h3><a id="user-content-training-on-a-single-vm" class="anchor" aria-label="Permalink: Training on a Single VM" href="#training-on-a-single-vm"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Loading the data is supported both locally from the disk created above, or from <code>gcs</code>. In this guide, we'll be using a gcs bucket to train. First copy the data to the GCS bucket.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="BUCKET_NAME=my-bucket
gcloud storage cp --recursive $TFRECORDS_DATASET_DIR gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}"><pre>BUCKET_NAME=my-bucket
gcloud storage cp --recursive <span class="pl-smi">$TFRECORDS_DATASET_DIR</span> gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span></pre></div>
<p dir="auto">Now run the training command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}
OUTPUT_DIR=gs://$BUCKET_NAME/wan/
DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/
EVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/
SAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/"><pre>RUN_NAME=jfacevedo-wan-v5p-8-<span class="pl-smi">${RANDOM}</span>
OUTPUT_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/wan/
DATASET_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/train/
EVAL_DATA_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/eval_timesteps/
SAVE_DATASET_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/save/</pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \
--xla_tpu_megacore_fusion_allow_ags=false \
--xla_enable_async_collective_permute=true \
--xla_tpu_enable_ag_backward_pipelining=true \
--xla_tpu_enable_data_parallel_all_reduce_opt=true \
--xla_tpu_data_parallel_opt_different_sized_ops=true \
--xla_tpu_enable_async_collective_fusion=true \
--xla_tpu_enable_async_collective_fusion_multiple_steps=true \
--xla_tpu_overlap_compute_collective_tc=true \
--xla_enable_async_all_gather=true \
--xla_tpu_scoped_vmem_limit_kib=65536 \
--xla_tpu_enable_async_all_to_all=true \
--xla_tpu_enable_all_experimental_scheduler_features=true \
--xla_tpu_enable_scheduler_memory_pressure_tracking=true \
--xla_tpu_host_transfer_overlap_limit=24 \
--xla_tpu_aggressive_opt_barrier_removal=ENABLED \
--xla_lhs_prioritize_async_depth_over_stall=ENABLED \
--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \
--xla_should_add_loop_invariant_op_in_chain=ENABLED \
--xla_max_concurrent_host_send_recv=100 \
--xla_tpu_scheduler_percent_shared_memory_limit=100 \
--xla_latency_hiding_scheduler_rerun=2 \
--xla_tpu_use_minor_sharding_for_major_trivial_input=true \
--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \
--xla_tpu_assign_all_reduce_scatter_layout=true'"><pre><span class="pl-k">export</span> LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">'</span>--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \</span>
<span class="pl-s">--xla_tpu_megacore_fusion_allow_ags=false \</span>
<span class="pl-s">--xla_enable_async_collective_permute=true \</span>
<span class="pl-s">--xla_tpu_enable_ag_backward_pipelining=true \</span>
<span class="pl-s">--xla_tpu_enable_data_parallel_all_reduce_opt=true \</span>
<span class="pl-s">--xla_tpu_data_parallel_opt_different_sized_ops=true \</span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion=true \</span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_multiple_steps=true \</span>
<span class="pl-s">--xla_tpu_overlap_compute_collective_tc=true \</span>
<span class="pl-s">--xla_enable_async_all_gather=true \</span>
<span class="pl-s">--xla_tpu_scoped_vmem_limit_kib=65536 \</span>
<span class="pl-s">--xla_tpu_enable_async_all_to_all=true \</span>
<span class="pl-s">--xla_tpu_enable_all_experimental_scheduler_features=true \</span>
<span class="pl-s">--xla_tpu_enable_scheduler_memory_pressure_tracking=true \</span>
<span class="pl-s">--xla_tpu_host_transfer_overlap_limit=24 \</span>
<span class="pl-s">--xla_tpu_aggressive_opt_barrier_removal=ENABLED \</span>
<span class="pl-s">--xla_lhs_prioritize_async_depth_over_stall=ENABLED \</span>
<span class="pl-s">--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \</span>
<span class="pl-s">--xla_should_add_loop_invariant_op_in_chain=ENABLED \</span>
<span class="pl-s">--xla_max_concurrent_host_send_recv=100 \</span>
<span class="pl-s">--xla_tpu_scheduler_percent_shared_memory_limit=100 \</span>
<span class="pl-s">--xla_latency_hiding_scheduler_rerun=2 \</span>
<span class="pl-s">--xla_tpu_use_minor_sharding_for_major_trivial_input=true \</span>
<span class="pl-s">--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \</span>
<span class="pl-s">--xla_tpu_assign_all_reduce_scatter_layout=true<span class="pl-pds">'</span></span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \
src/maxdiffusion/configs/base_wan_14b.yml \
attention='flash' \
weights_dtype=bfloat16 \
activations_dtype=bfloat16 \
guidance_scale=5.0 \
flow_shift=5.0 \
fps=16 \
skip_jax_distributed_system=False \
run_name=${RUN_NAME} \
output_dir=${OUTPUT_DIR} \
train_data_dir=${DATASET_DIR} \
load_tfrecord_cached=True \
height=1280 \
width=720 \
num_frames=81 \
num_inference_steps=50 \
jax_cache_dir=${OUTPUT_DIR}/jax_cache/ \
max_train_steps=1000 \
enable_profiler=True \
dataset_save_location=${SAVE_DATASET_DIR} \
remat_policy='HIDDEN_STATE_WITH_OFFLOAD' \
flash_min_seq_length=0 \
seed=$RANDOM \
skip_first_n_steps_for_profiler=3 \
profiler_steps=3 \
per_device_batch_size=0.25 \
ici_data_parallelism=1 \
ici_fsdp_parallelism=4 \
ici_tensor_parallelism=1"><pre>HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \
src/maxdiffusion/configs/base_wan_14b.yml \
attention=<span class="pl-s"><span class="pl-pds">'</span>flash<span class="pl-pds">'</span></span> \
weights_dtype=bfloat16 \
activations_dtype=bfloat16 \
guidance_scale=5.0 \
flow_shift=5.0 \
fps=16 \
skip_jax_distributed_system=False \
run_name=<span class="pl-smi">${RUN_NAME}</span> \
output_dir=<span class="pl-smi">${OUTPUT_DIR}</span> \
train_data_dir=<span class="pl-smi">${DATASET_DIR}</span> \
load_tfrecord_cached=True \
height=1280 \
width=720 \
num_frames=81 \
num_inference_steps=50 \
jax_cache_dir=<span class="pl-smi">${OUTPUT_DIR}</span>/jax_cache/ \
max_train_steps=1000 \
enable_profiler=True \
dataset_save_location=<span class="pl-smi">${SAVE_DATASET_DIR}</span> \
remat_policy=<span class="pl-s"><span class="pl-pds">'</span>HIDDEN_STATE_WITH_OFFLOAD<span class="pl-pds">'</span></span> \
flash_min_seq_length=0 \
seed=<span class="pl-smi">$RANDOM</span> \
skip_first_n_steps_for_profiler=3 \
profiler_steps=3 \
per_device_batch_size=0.25 \
ici_data_parallelism=1 \
ici_fsdp_parallelism=4 \
ici_tensor_parallelism=1</pre></div>
<p dir="auto">It is important to note a couple of things:</p>
<ul dir="auto">
<li>per_device_batch_size can be a fractional, but must be a whole number when multiplied by number of devices. In this example, 0.25 * 4 (devices) = effective global batch size = 1.</li>
<li>The step time in v5p-8 with global batch size = 1 is large due to using <code>FULL</code> remat. On larger number of chips we can run larger batch sizes greatly increasing MFU, as we will see in the next session of deploying with xpk.</li>
<li>To enable eval during training set <code>eval_every</code> to a value &gt; 0.</li>
<li>In Wan2.1, the ici_fsdp_parallelism axis is used for sequence parallelism, the ici_tensor_parallelism axis is used for head parallelism.
<ul dir="auto">
<li>You can enable both, keeping in mind that Wan2.1 has 40 heads and 40 must be evenly divisible by ici_tensor_parallelism.</li>
<li>For Sequence parallelism, the code pads the sequence length to evenly divide the sequence. Try out different ici_fsdp_parallelism numbers, but we find 2 and 4 to be the best right now.</li>
</ul>
</li>
<li>For use on GPU it is recommended to enable the cudnn_te_flash attention kernel for optimal performance.
<ul dir="auto">
<li>Best performance is achieved with the use of batch parallelism, which can be enabled by using the ici_fsdp_batch_parallelism axis. Note that this parallelism strategy does not support fractional batch sizes.</li>
<li>ici_fsdp_batch_parallelism and ici_fsdp_parallelism can be combined to allow for fractional batch sizes. However, padding is not currently supported for the cudnn_te_flash attention kernel and it is therefore required that the sequence length is divisible by the number of devices in the ici_fsdp_parallelism axis.</li>
</ul>
</li>
<li>For benchmarking training performance on multiple data dimension input without downloading/re-processing the dataset, the synthetic data iterator is supported.
<ul dir="auto">
<li>Set dataset_type='synthetic' and synthetic_num_samples=null to enable the synthetic data iterator.</li>
<li>The following overrides on data dimensions are supported:
<ul dir="auto">
<li>synthetic_override_height: 720</li>
<li>synthetic_override_width: 1280</li>
<li>synthetic_override_num_frames: 85</li>
<li>synthetic_override_max_sequence_length: 512</li>
<li>synthetic_override_text_embed_dim: 4096</li>
<li>synthetic_override_num_channels_latents: 16</li>
<li>synthetic_override_vae_scale_factor_spatial: 8</li>
<li>synthetic_override_vae_scale_factor_temporal: 4</li>
</ul>
</li>
</ul>
</li>
</ul>
<p dir="auto">You should eventually see a training run as:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="***** Running training *****
Instantaneous batch size per device = 0.25
Total train batch size (w. parallel &amp; distributed) = 1
Total optimization steps = 1000
Calculated TFLOPs per pass: 4893.2719
Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices in data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
completed step: 0, seconds: 142.395, TFLOP/s/device: 34.364, loss: 0.270
To see full metrics 'tensorboard --logdir=gs://jfacevedo-maxdiffusion-v5p/wan/jfacevedo-wan-v5p-8-17263/tensorboard/'
completed step: 1, seconds: 137.207, TFLOP/s/device: 35.664, loss: 0.144
completed step: 2, seconds: 36.014, TFLOP/s/device: 135.871, loss: 0.210
completed step: 3, seconds: 36.016, TFLOP/s/device: 135.864, loss: 0.120
completed step: 4, seconds: 36.008, TFLOP/s/device: 135.894, loss: 0.107
completed step: 5, seconds: 36.008, TFLOP/s/device: 135.895, loss: 0.346
completed step: 6, seconds: 36.006, TFLOP/s/device: 135.900, loss: 0.169"><pre><span class="pl-k">*****</span> Running training <span class="pl-k">*****</span>
Instantaneous batch size per device = 0.25
Total train batch size (w. parallel <span class="pl-k">&amp;</span> distributed) = 1
Total optimization steps = 1000
Calculated TFLOPs per pass: 4893.2719
Warning, batch dimension should be shardable among the devices <span class="pl-k">in</span> data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices <span class="pl-k">in</span> data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices <span class="pl-k">in</span> data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
Warning, batch dimension should be shardable among the devices <span class="pl-k">in</span> data and fsdp axis, batch dimension: 1, devices_in_data_fsdp: 4
completed step: 0, seconds: 142.395, TFLOP/s/device: 34.364, loss: 0.270
To see full metrics <span class="pl-s"><span class="pl-pds">'</span>tensorboard --logdir=gs://jfacevedo-maxdiffusion-v5p/wan/jfacevedo-wan-v5p-8-17263/tensorboard/<span class="pl-pds">'</span></span>
completed step: 1, seconds: 137.207, TFLOP/s/device: 35.664, loss: 0.144
completed step: 2, seconds: 36.014, TFLOP/s/device: 135.871, loss: 0.210
completed step: 3, seconds: 36.016, TFLOP/s/device: 135.864, loss: 0.120
completed step: 4, seconds: 36.008, TFLOP/s/device: 135.894, loss: 0.107
completed step: 5, seconds: 36.008, TFLOP/s/device: 135.895, loss: 0.346
completed step: 6, seconds: 36.006, TFLOP/s/device: 135.900, loss: 0.169</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Deploying with XPK</h3><a id="user-content-deploying-with-xpk" class="anchor" aria-label="Permalink: Deploying with XPK" href="#deploying-with-xpk"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">This assumes the user has already created an xpk cluster, installed all dependencies and the also created the dataset from the step above. For getting started with MaxDiffusion and xpk see <a href="/AI-Hypercomputer/maxdiffusion/blob/main/docs/getting_started/run_maxdiffusion_via_xpk.md">this guide</a>.</p>
<p dir="auto">Using v5p-256 Then the command to run on xpk is as follows:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="RUN_NAME=jfacevedo-wan-v5p-8-${RANDOM}
OUTPUT_DIR=gs://$BUCKET_NAME/wan/
DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/train/
EVAL_DATA_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/eval_timesteps/
SAVE_DATASET_DIR=gs://$BUCKET_NAME/${TFRECORDS_DATASET_DIR##*/}/save/"><pre>RUN_NAME=jfacevedo-wan-v5p-8-<span class="pl-smi">${RANDOM}</span>
OUTPUT_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/wan/
DATASET_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/train/
EVAL_DATA_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/eval_timesteps/
SAVE_DATASET_DIR=gs://<span class="pl-smi">$BUCKET_NAME</span>/<span class="pl-smi">${TFRECORDS_DATASET_DIR<span class="pl-k">##*/</span>}</span>/save/</pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="LIBTPU_INIT_ARGS='--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \
--xla_tpu_megacore_fusion_allow_ags=false \
--xla_enable_async_collective_permute=true \
--xla_tpu_enable_ag_backward_pipelining=true \
--xla_tpu_enable_data_parallel_all_reduce_opt=true \
--xla_tpu_data_parallel_opt_different_sized_ops=true \
--xla_tpu_enable_async_collective_fusion=true \
--xla_tpu_enable_async_collective_fusion_multiple_steps=true \
--xla_tpu_overlap_compute_collective_tc=true \
--xla_enable_async_all_gather=true \
--xla_tpu_scoped_vmem_limit_kib=65536 \
--xla_tpu_enable_async_all_to_all=true \
--xla_tpu_enable_all_experimental_scheduler_features=true \
--xla_tpu_enable_scheduler_memory_pressure_tracking=true \
--xla_tpu_host_transfer_overlap_limit=24 \
--xla_tpu_aggressive_opt_barrier_removal=ENABLED \
--xla_lhs_prioritize_async_depth_over_stall=ENABLED \
--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \
--xla_should_add_loop_invariant_op_in_chain=ENABLED \
--xla_max_concurrent_host_send_recv=100 \
--xla_tpu_scheduler_percent_shared_memory_limit=100 \
--xla_latency_hiding_scheduler_rerun=2 \
--xla_tpu_use_minor_sharding_for_major_trivial_input=true \
--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \
--xla_tpu_assign_all_reduce_scatter_layout=true'"><pre>LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">'</span>--xla_tpu_enable_async_collective_fusion_fuse_all_gather=true \</span>
<span class="pl-s">--xla_tpu_megacore_fusion_allow_ags=false \</span>
<span class="pl-s">--xla_enable_async_collective_permute=true \</span>
<span class="pl-s">--xla_tpu_enable_ag_backward_pipelining=true \</span>
<span class="pl-s">--xla_tpu_enable_data_parallel_all_reduce_opt=true \</span>
<span class="pl-s">--xla_tpu_data_parallel_opt_different_sized_ops=true \</span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion=true \</span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_multiple_steps=true \</span>
<span class="pl-s">--xla_tpu_overlap_compute_collective_tc=true \</span>
<span class="pl-s">--xla_enable_async_all_gather=true \</span>
<span class="pl-s">--xla_tpu_scoped_vmem_limit_kib=65536 \</span>
<span class="pl-s">--xla_tpu_enable_async_all_to_all=true \</span>
<span class="pl-s">--xla_tpu_enable_all_experimental_scheduler_features=true \</span>
<span class="pl-s">--xla_tpu_enable_scheduler_memory_pressure_tracking=true \</span>
<span class="pl-s">--xla_tpu_host_transfer_overlap_limit=24 \</span>
<span class="pl-s">--xla_tpu_aggressive_opt_barrier_removal=ENABLED \</span>
<span class="pl-s">--xla_lhs_prioritize_async_depth_over_stall=ENABLED \</span>
<span class="pl-s">--xla_should_allow_loop_variant_parameter_in_chain=ENABLED \</span>
<span class="pl-s">--xla_should_add_loop_invariant_op_in_chain=ENABLED \</span>
<span class="pl-s">--xla_max_concurrent_host_send_recv=100 \</span>
<span class="pl-s">--xla_tpu_scheduler_percent_shared_memory_limit=100 \</span>
<span class="pl-s">--xla_latency_hiding_scheduler_rerun=2 \</span>
<span class="pl-s">--xla_tpu_use_minor_sharding_for_major_trivial_input=true \</span>
<span class="pl-s">--xla_tpu_relayout_group_size_threshold_for_reduce_scatter=1 \</span>
<span class="pl-s">--xla_tpu_assign_all_reduce_scatter_layout=true<span class="pl-pds">'</span></span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python3 ~/xpk/xpk.py workload create \
--cluster=$CLUSTER_NAME \
--project=$PROJECT \
--zone=$ZONE \
--device-type=$DEVICE_TYPE \
--num-slices=1 \
--command=&quot; \
HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py \
src/maxdiffusion/configs/base_wan_14b.yml \
attention='flash' \
weights_dtype=bfloat16 \
activations_dtype=bfloat16 \
guidance_scale=5.0 \
flow_shift=5.0 \
fps=16 \
skip_jax_distributed_system=False \
run_name=${RUN_NAME} \
output_dir=${OUTPUT_DIR} \
train_data_dir=${DATASET_DIR} \
load_tfrecord_cached=True \
height=1280 \
width=720 \
num_frames=81 \
num_inference_steps=50 \
jax_cache_dir=${OUTPUT_DIR}/jax_cache/ \
enable_profiler=True \
dataset_save_location=${SAVE_DATASET_DIR} \
remat_policy='HIDDEN_STATE_WITH_OFFLOAD' \
flash_min_seq_length=0 \
seed=$RANDOM \
skip_first_n_steps_for_profiler=3 \
profiler_steps=3 \
per_device_batch_size=0.25 \
ici_data_parallelism=32 \
ici_fsdp_parallelism=4 \
ici_tensor_parallelism=1 \
max_train_steps=5000 \
eval_every=100 \
eval_data_dir=${EVAL_DATA_DIR} \
enable_generate_video_for_eval=True&quot; \
--base-docker-image=${IMAGE_DIR} \
--enable-debug-logs \
--workload=${RUN_NAME} \
--priority=medium \
--max-restarts=0"><pre>python3 <span class="pl-k">~</span>/xpk/xpk.py workload create \
--cluster=<span class="pl-smi">$CLUSTER_NAME</span> \
--project=<span class="pl-smi">$PROJECT</span> \
--zone=<span class="pl-smi">$ZONE</span> \
--device-type=<span class="pl-smi">$DEVICE_TYPE</span> \
--num-slices=1 \
--command=<span class="pl-s"><span class="pl-pds">"</span> <span class="pl-cce">\</span></span>
<span class="pl-s">HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ python src/maxdiffusion/train_wan.py <span class="pl-cce">\</span></span>
<span class="pl-s">src/maxdiffusion/configs/base_wan_14b.yml <span class="pl-cce">\</span></span>
<span class="pl-s">attention='flash' <span class="pl-cce">\</span></span>
<span class="pl-s">weights_dtype=bfloat16 <span class="pl-cce">\</span></span>
<span class="pl-s">activations_dtype=bfloat16 <span class="pl-cce">\</span></span>
<span class="pl-s">guidance_scale=5.0 <span class="pl-cce">\</span></span>
<span class="pl-s">flow_shift=5.0 <span class="pl-cce">\</span></span>
<span class="pl-s">fps=16 <span class="pl-cce">\</span></span>
<span class="pl-s">skip_jax_distributed_system=False <span class="pl-cce">\</span></span>
<span class="pl-s">run_name=<span class="pl-smi">${RUN_NAME}</span> <span class="pl-cce">\</span></span>
<span class="pl-s">output_dir=<span class="pl-smi">${OUTPUT_DIR}</span> <span class="pl-cce">\</span></span>
<span class="pl-s">train_data_dir=<span class="pl-smi">${DATASET_DIR}</span> <span class="pl-cce">\</span></span>
<span class="pl-s">load_tfrecord_cached=True <span class="pl-cce">\</span></span>
<span class="pl-s">height=1280 <span class="pl-cce">\</span></span>
<span class="pl-s">width=720 <span class="pl-cce">\</span></span>
<span class="pl-s">num_frames=81 <span class="pl-cce">\</span></span>
<span class="pl-s">num_inference_steps=50 <span class="pl-cce">\</span></span>
<span class="pl-s">jax_cache_dir=<span class="pl-smi">${OUTPUT_DIR}</span>/jax_cache/ <span class="pl-cce">\</span></span>
<span class="pl-s">enable_profiler=True <span class="pl-cce">\</span></span>
<span class="pl-s">dataset_save_location=<span class="pl-smi">${SAVE_DATASET_DIR}</span> <span class="pl-cce">\</span></span>
<span class="pl-s">remat_policy='HIDDEN_STATE_WITH_OFFLOAD' <span class="pl-cce">\</span></span>
<span class="pl-s">flash_min_seq_length=0 <span class="pl-cce">\</span></span>
<span class="pl-s">seed=<span class="pl-smi">$RANDOM</span> <span class="pl-cce">\</span></span>
<span class="pl-s">skip_first_n_steps_for_profiler=3 <span class="pl-cce">\</span></span>
<span class="pl-s">profiler_steps=3 <span class="pl-cce">\</span></span>
<span class="pl-s">per_device_batch_size=0.25 <span class="pl-cce">\</span></span>
<span class="pl-s">ici_data_parallelism=32 <span class="pl-cce">\</span></span>
<span class="pl-s">ici_fsdp_parallelism=4 <span class="pl-cce">\</span></span>
<span class="pl-s">ici_tensor_parallelism=1 <span class="pl-cce">\</span></span>
<span class="pl-s">max_train_steps=5000 <span class="pl-cce">\</span></span>
<span class="pl-s">eval_every=100 <span class="pl-cce">\</span></span>
<span class="pl-s">eval_data_dir=<span class="pl-smi">${EVAL_DATA_DIR}</span> <span class="pl-cce">\</span></span>
<span class="pl-s">enable_generate_video_for_eval=True<span class="pl-pds">"</span></span> \
--base-docker-image=<span class="pl-smi">${IMAGE_DIR}</span> \
--enable-debug-logs \
--workload=<span class="pl-smi">${RUN_NAME}</span> \
--priority=medium \
--max-restarts=0</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Flux Training</h2><a id="user-content-flux-training" class="anchor" aria-label="Permalink: Flux Training" href="#flux-training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Expected results on 1024 x 1024 images with flash attention and bfloat16:</p>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Model</th>
<th>Accelerator</th>
<th>Sharding Strategy</th>
<th>Per Device Batch Size</th>
<th>Global Batch Size</th>
<th>Step Time (secs)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Flux-dev</td>
<td>v5p-8</td>
<td>FSDP</td>
<td>2</td>
<td>8</td>
<td>1.769</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto">Flux finetuning has only been tested on TPU v5p.</p>
<p dir="auto">To run the Flux training benchmark on v5p-8, use:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/train_flux.py src/maxdiffusion/configs/base_flux_dev.yml \
    run_name=&quot;flux-training&quot; \
    output_dir=&quot;gs://&lt;your-gcs-bucket&gt;/&quot; \
    jax_cache_dir=&quot;/tmp/jax_cache&quot; \
    save_final_checkpoint=False \
    max_train_steps=100 \
    dataset_type=synthetic \
    ici_data_parallelism=1 \
    ici_fsdp_parallelism=4 \
    ici_tensor_parallelism=1 \
    train_new_flux=True \
    resolution=1024 \
    attention_sharding_uniform=False \
    attention=tokamax_flash \
    per_device_batch_size=2 \
    enable_profiler=False \
    reuse_example_batch=True \
    write_metrics=False \
    use_base2_exp=True"><pre>python src/maxdiffusion/train_flux.py src/maxdiffusion/configs/base_flux_dev.yml \
    run_name=<span class="pl-s"><span class="pl-pds">"</span>flux-training<span class="pl-pds">"</span></span> \
    output_dir=<span class="pl-s"><span class="pl-pds">"</span>gs://&lt;your-gcs-bucket&gt;/<span class="pl-pds">"</span></span> \
    jax_cache_dir=<span class="pl-s"><span class="pl-pds">"</span>/tmp/jax_cache<span class="pl-pds">"</span></span> \
    save_final_checkpoint=False \
    max_train_steps=100 \
    dataset_type=synthetic \
    ici_data_parallelism=1 \
    ici_fsdp_parallelism=4 \
    ici_tensor_parallelism=1 \
    train_new_flux=True \
    resolution=1024 \
    attention_sharding_uniform=False \
    attention=tokamax_flash \
    per_device_batch_size=2 \
    enable_profiler=False \
    reuse_example_batch=True \
    write_metrics=False \
    use_base2_exp=True</pre></div>
<p dir="auto">To generate images with a finetuned checkpoint, run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux_pipeline.py src/maxdiffusion/configs/base_flux_dev.yml  run_name=&quot;test-flux-train&quot; output_dir=&quot;gs://&lt;your-gcs-bucket&gt;/&quot; jax_cache_dir=&quot;/tmp/jax_cache&quot;"><pre>python src/maxdiffusion/generate_flux_pipeline.py src/maxdiffusion/configs/base_flux_dev.yml  run_name=<span class="pl-s"><span class="pl-pds">"</span>test-flux-train<span class="pl-pds">"</span></span> output_dir=<span class="pl-s"><span class="pl-pds">"</span>gs://&lt;your-gcs-bucket&gt;/<span class="pl-pds">"</span></span> jax_cache_dir=<span class="pl-s"><span class="pl-pds">"</span>/tmp/jax_cache<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion XL Training</h2><a id="user-content-stable-diffusion-xl-training" class="anchor" aria-label="Permalink: Stable Diffusion XL Training" href="#stable-diffusion-xl-training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export LIBTPU_INIT_ARGS=&quot;&quot;
python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml run_name=&quot;my_xl_run&quot; output_dir=&quot;gs://your-bucket/&quot; per_device_batch_size=1"><pre><span class="pl-k">export</span> LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_xl_run<span class="pl-pds">"</span></span> output_dir=<span class="pl-s"><span class="pl-pds">"</span>gs://your-bucket/<span class="pl-pds">"</span></span> per_device_batch_size=1</pre></div>
<p dir="auto">On GPUS with Fused Attention:</p>
<p dir="auto">First install Transformer Engine by following the <a href="#fused-attention-for-gpu">instructions here</a>.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="NVTE_FUSED_ATTN=1 python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml hardware=gpu run_name='test-sdxl-train' output_dir=/tmp/ train_new_unet=true train_text_encoder=false cache_latents_text_encoder_outputs=true max_train_steps=200 weights_dtype=bfloat16 resolution=512 per_device_batch_size=1 attention=&quot;cudnn_flash_te&quot; jit_initializers=False"><pre>NVTE_FUSED_ATTN=1 python -m src.maxdiffusion.train_sdxl src/maxdiffusion/configs/base_xl.yml hardware=gpu run_name=<span class="pl-s"><span class="pl-pds">'</span>test-sdxl-train<span class="pl-pds">'</span></span> output_dir=/tmp/ train_new_unet=true train_text_encoder=false cache_latents_text_encoder_outputs=true max_train_steps=200 weights_dtype=bfloat16 resolution=512 per_device_batch_size=1 attention=<span class="pl-s"><span class="pl-pds">"</span>cudnn_flash_te<span class="pl-pds">"</span></span> jit_initializers=False</pre></div>
<p dir="auto">To generate images with a trained checkpoint, run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_xl.yml run_name=&quot;my_run&quot; pretrained_model_name_or_path=&lt;your_saved_checkpoint_path&gt; from_pt=False attention=dot_product"><pre>python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_xl.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span> pretrained_model_name_or_path=<span class="pl-k">&lt;</span>your_saved_checkpoint_path<span class="pl-k">&gt;</span> from_pt=False attention=dot_product</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion 2 base Training</h2><a id="user-content-stable-diffusion-2-base-training" class="anchor" aria-label="Permalink: Stable Diffusion 2 base Training" href="#stable-diffusion-2-base-training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export LIBTPU_INIT_ARGS=&quot;&quot;
python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=&quot;my_run&quot; jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash"><pre><span class="pl-k">export</span> LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span> jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion 1.4 Training</h2><a id="user-content-stable-diffusion-14-training" class="anchor" aria-label="Permalink: Stable Diffusion 1.4 Training" href="#stable-diffusion-14-training"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export LIBTPU_INIT_ARGS=&quot;&quot;
python -m src.maxdiffusion.train src/maxdiffusion/configs/base14.yml run_name=&quot;my_run&quot; jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash"><pre><span class="pl-k">export</span> LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
python -m src.maxdiffusion.train src/maxdiffusion/configs/base14.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span> jax_cache_dir=gs://your-bucket/cache_dir activations_dtype=float32 weights_dtype=float32 per_device_batch_size=2 precision=DEFAULT dataset_save_location=/tmp/my_dataset/ output_dir=gs://your-bucket/ attention=flash</pre></div>
<p dir="auto">To generate images with a trained checkpoint, run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=&quot;my_run&quot; output_dir=gs://your-bucket/ from_pt=False attention=dot_product"><pre>python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span> output_dir=gs://your-bucket/ from_pt=False attention=dot_product</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Dreambooth</h2><a id="user-content-dreambooth" class="anchor" aria-label="Permalink: Dreambooth" href="#dreambooth"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Supported models are <strong>Stable Diffusion 1.x,2.x</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/dreambooth/train_dreambooth.py src/maxdiffusion/configs/base14.yml class_data_dir=&lt;your-class-dir&gt; instance_data_dir=&lt;your-instance-dir&gt; instance_prompt=&quot;a photo of ohwx dog&quot; class_prompt=&quot;photo of a dog&quot; max_train_steps=150 jax_cache_dir=&lt;your-cache-dir&gt; class_prompt=&quot;a photo of a dog&quot; activations_dtype=bfloat16 weights_dtype=float32 per_device_batch_size=1 enable_profiler=False precision=DEFAULT cache_dreambooth_dataset=False learning_rate=4e-6 num_class_images=100 run_name=&lt;your-run-name&gt; output_dir=gs://&lt;your-bucket-name&gt;"><pre>python src/maxdiffusion/dreambooth/train_dreambooth.py src/maxdiffusion/configs/base14.yml class_data_dir=<span class="pl-k">&lt;</span>your-class-dir<span class="pl-k">&gt;</span> instance_data_dir=<span class="pl-k">&lt;</span>your-instance-dir<span class="pl-k">&gt;</span> instance_prompt=<span class="pl-s"><span class="pl-pds">"</span>a photo of ohwx dog<span class="pl-pds">"</span></span> class_prompt=<span class="pl-s"><span class="pl-pds">"</span>photo of a dog<span class="pl-pds">"</span></span> max_train_steps=150 jax_cache_dir=<span class="pl-k">&lt;</span>your-cache-dir<span class="pl-k">&gt;</span> class_prompt=<span class="pl-s"><span class="pl-pds">"</span>a photo of a dog<span class="pl-pds">"</span></span> activations_dtype=bfloat16 weights_dtype=float32 per_device_batch_size=1 enable_profiler=False precision=DEFAULT cache_dreambooth_dataset=False learning_rate=4e-6 num_class_images=100 run_name=<span class="pl-k">&lt;</span>your-run-name<span class="pl-k">&gt;</span> output_dir=gs://<span class="pl-k">&lt;</span>your-bucket-name<span class="pl-k">&gt;</span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Inference</h2><a id="user-content-inference" class="anchor" aria-label="Permalink: Inference" href="#inference"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">To generate images, run the following command:</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion XL</h2><a id="user-content-stable-diffusion-xl" class="anchor" aria-label="Permalink: Stable Diffusion XL" href="#stable-diffusion-xl"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Single and Multi host inference is supported with sharding annotations:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl.yml run_name=&quot;my_run&quot;"><pre>python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Single host pmap version:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate_sdxl_replicated"><pre>python -m src.maxdiffusion.generate_sdxl_replicated</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion 2 base</h2><a id="user-content-stable-diffusion-2-base" class="anchor" aria-label="Permalink: Stable Diffusion 2 base" href="#stable-diffusion-2-base"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=&quot;my_run&quot;"><pre>python -m src.maxdiffusion.generate src/maxdiffusion/configs/base_2_base.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion 2.1</h2><a id="user-content-stable-diffusion-21" class="anchor" aria-label="Permalink: Stable Diffusion 2.1" href="#stable-diffusion-21"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate src/maxdiffusion/configs/base21.yml run_name=&quot;my_run&quot;"><pre>python -m src.maxdiffusion.generate src/maxdiffusion/configs/base21.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">LTX-Video</h2><a id="user-content-ltx-video" class="anchor" aria-label="Permalink: LTX-Video" href="#ltx-video"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">In the folder src/maxdiffusion/models/ltx_video/utils, run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python convert_torch_weights_to_jax.py --ckpt_path [LOCAL DIRECTORY FOR WEIGHTS] --transformer_config_path ../ltxv-13B.json"><pre>python convert_torch_weights_to_jax.py --ckpt_path [LOCAL DIRECTORY FOR WEIGHTS] --transformer_config_path ../ltxv-13B.json</pre></div>
<p dir="auto">In the repo folder, run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_ltx_video.py src/maxdiffusion/configs/ltx_video.yml output_dir=&quot;[SAME DIRECTORY]&quot; config_path=&quot;src/maxdiffusion/models/ltx_video/ltxv-13B.json&quot;"><pre>python src/maxdiffusion/generate_ltx_video.py src/maxdiffusion/configs/ltx_video.yml output_dir=<span class="pl-s"><span class="pl-pds">"</span>[SAME DIRECTORY]<span class="pl-pds">"</span></span> config_path=<span class="pl-s"><span class="pl-pds">"</span>src/maxdiffusion/models/ltx_video/ltxv-13B.json<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Img2video Generation:</p>
<p dir="auto">Add conditioning image path as conditioning_media_paths in the form of ["IMAGE_PATH"] along with other generation parameters in the ltx_video.yml file. Then follow same instruction as above.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">LTX-2 Video</h2><a id="user-content-ltx-2-video" class="anchor" aria-label="Permalink: LTX-2 Video" href="#ltx-2-video"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Although not required, attaching an external disk is recommended as weights take up a lot of disk space. <a href="https://cloud.google.com/tpu/docs/attach-durable-block-storage" rel="nofollow">Follow these instructions if you would like to attach an external disk</a>.</p>
<p dir="auto">The following command will run LTX-2 T2V:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=&quot;--xla_tpu_enable_async_collective_fusion=true \
--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \
--xla_tpu_enable_async_collective_fusion_multiple_steps=true \
--xla_tpu_overlap_compute_collective_tc=true \
--xla_enable_async_all_reduce=true&quot; \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_ltx2.py \
src/maxdiffusion/configs/ltx2_video.yml \
attention=&quot;flash&quot; \
num_inference_steps=40 \
num_frames=121 \
width=768 \
height=512 \
per_device_batch_size=.125 \
ici_data_parallelism=2 \
ici_context_parallelism=4 \
run_name=ltx2-inference"><pre>HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span>--xla_tpu_enable_async_collective_fusion=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_multiple_steps=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_overlap_compute_collective_tc=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_enable_async_all_reduce=true<span class="pl-pds">"</span></span> \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_ltx2.py \
src/maxdiffusion/configs/ltx2_video.yml \
attention=<span class="pl-s"><span class="pl-pds">"</span>flash<span class="pl-pds">"</span></span> \
num_inference_steps=40 \
num_frames=121 \
width=768 \
height=512 \
per_device_batch_size=.125 \
ici_data_parallelism=2 \
ici_context_parallelism=4 \
run_name=ltx2-inference</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Wan Models</h2><a id="user-content-wan-models" class="anchor" aria-label="Permalink: Wan Models" href="#wan-models"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Although not required, attaching an external disk is recommended as weights take up a lot of disk space. <a href="https://cloud.google.com/tpu/docs/attach-durable-block-storage" rel="nofollow">Follow these instructions if you would like to attach an external disk</a>.</p>
<p dir="auto">Supports both Text2Vid and Img2Vid pipelines.</p>
<p dir="auto"><strong>Note</strong>: The product of per_device_batch_size and num_devices must be equal to a whole number.</p>
<p dir="auto">The below command uses 4 devices and a per_device_batch_size=0.25. Thus, 4 * 0.25 = 1. This will generate a single video. Setting per_device_batch_size to 0.5, will generate 2 videos and so on.</p>
<p dir="auto">If using 8 devices, then per_device_batch_size=0.125 will generate 1 video, per_device_batch_size=0.25 generates 2 videos.</p>
<p dir="auto">The following command will run Wan2.1 T2V:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=&quot;--xla_tpu_enable_async_collective_fusion=true \
--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \
--xla_tpu_enable_async_collective_fusion_multiple_steps=true \
--xla_tpu_overlap_compute_collective_tc=true \
--xla_enable_async_all_reduce=true&quot; \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_14b.yml \
attention=&quot;flash&quot; \
num_inference_steps=50 \
num_frames=81 \
width=1280 \
height=720 \
jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \
per_device_batch_size=.0.25 \
ici_data_parallelism=2 \
ici_context_parallelism=2 \
flow_shift=5.0 \
enable_profiler=True \
run_name=wan-inference-testing-720p \
output_dir=gs:/jfacevedo-maxdiffusion \
fps=16 \
flash_min_seq_length=0 \
flash_block_sizes='{&quot;block_q&quot; : 3024, &quot;block_kv_compute&quot; : 1024, &quot;block_kv&quot; : 2048, &quot;block_q_dkv&quot;: 3024, &quot;block_kv_dkv&quot; : 2048, &quot;block_kv_dkv_compute&quot; : 2048, &quot;block_q_dq&quot; : 3024, &quot;block_kv_dq&quot; : 2048 }' \
seed=118445"><pre>HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span>--xla_tpu_enable_async_collective_fusion=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_multiple_steps=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_overlap_compute_collective_tc=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_enable_async_all_reduce=true<span class="pl-pds">"</span></span> \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_14b.yml \
attention=<span class="pl-s"><span class="pl-pds">"</span>flash<span class="pl-pds">"</span></span> \
num_inference_steps=50 \
num_frames=81 \
width=1280 \
height=720 \
jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \
per_device_batch_size=.0.25 \
ici_data_parallelism=2 \
ici_context_parallelism=2 \
flow_shift=5.0 \
enable_profiler=True \
run_name=wan-inference-testing-720p \
output_dir=gs:/jfacevedo-maxdiffusion \
fps=16 \
flash_min_seq_length=0 \
flash_block_sizes=<span class="pl-s"><span class="pl-pds">'</span>{"block_q" : 3024, "block_kv_compute" : 1024, "block_kv" : 2048, "block_q_dkv": 3024, "block_kv_dkv" : 2048, "block_kv_dkv_compute" : 2048, "block_q_dq" : 3024, "block_kv_dq" : 2048 }<span class="pl-pds">'</span></span> \
seed=118445</pre></div>
<p dir="auto">To run other Wan model inference pipelines, change the config file in the command above:</p>
<ul dir="auto">
<li>For Wan2.1 I2V, use <code>base_wan_i2v_14b.yml</code>.</li>
<li>For Wan2.2 T2V, use <code>base_wan_27b.yml</code>.</li>
<li>For Wan2.2 I2V, use <code>base_wan_i2v_27b.yml</code>.</li>
</ul>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Ulysses Attention</h3><a id="user-content-ulysses-attention" class="anchor" aria-label="Permalink: Ulysses Attention" href="#ulysses-attention"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">MaxDiffusion supports Ulysses attention for WAN TPU inference. Enable it by setting <code>attention="ulysses"</code>.</p>
<p dir="auto">Internally, this follows the Ulysses sequence-parallel attention pattern and trades sequence shards for head shards around the local TPU splash kernel. For background, see <a href="https://arxiv.org/abs/2309.14509" rel="nofollow">DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models</a>.</p>
<p dir="auto">To enable Ulysses attention, set the corresponding override in your config YAML or pass it as a command-line override:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
attention=&quot;ulysses&quot; \
ici_context_parallelism=4 \
..."><pre>python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
attention=<span class="pl-s"><span class="pl-pds">"</span>ulysses<span class="pl-pds">"</span></span> \
ici_context_parallelism=4 \
...</pre></div>
<p dir="auto">Ulysses requires <code>ici_context_parallelism</code> greater than 1, and the number of attention heads must be divisible by the context shard count. <code>flash_block_sizes</code> tuning is optional and can still be used for hardware-specific tuning.</p>
<p dir="auto">In our Wan2.2 I2V benchmarks at 40 inference steps, 81 frames, and <code>720x1280</code> resolution, Ulysses improved inference time by roughly <code>~10%</code> compared with flash attention, with about <code>~20s</code> lower latency on the v6e-8 and v7x-8 TPU setup.</p>
<div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Chunked Ulysses Attention (Overlapping Communication and Compute)</h4><a id="user-content-chunked-ulysses-attention-overlapping-communication-and-compute" class="anchor" aria-label="Permalink: Chunked Ulysses Attention (Overlapping Communication and Compute)" href="#chunked-ulysses-attention-overlapping-communication-and-compute"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">If you observe a major <code>all-to-all</code> communication bottleneck (especially when communication overhead is more pronounced compared to attention computation), you can enable <strong>Chunked Ulysses Attention</strong>.</p>
<p dir="auto">By setting <code>ulysses_attention_chunks</code> greater than 1, MaxDiffusion splits the Ulysses all-to-all communication and attention computation into head-group passes (chunks). This allows XLA to overlap the all-to-all communication of one chunk with the head-parallel local attention compute of another chunk, significantly mitigating the communication bottleneck.</p>
<p dir="auto">This chunking technique is supported and works for both plain Ulysses attention (<code>attention="ulysses"</code>) and hybrid Ulysses+Ring 2D attention/context parallelism (<code>attention="ulysses_ring"</code>).</p>
<p dir="auto">To enable chunked Ulysses attention, set the corresponding override (e.g. <code>ulysses_attention_chunks=2</code> or <code>ulysses_attention_chunks=5</code>) in your config YAML or command line:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
attention=&quot;ulysses&quot; \
ici_context_parallelism=4 \
ulysses_attention_chunks=2 \
..."><pre>python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
attention=<span class="pl-s"><span class="pl-pds">"</span>ulysses<span class="pl-pds">"</span></span> \
ici_context_parallelism=4 \
ulysses_attention_chunks=2 \
...</pre></div>
<div class="markdown-alert markdown-alert-important" dir="auto"><p class="markdown-alert-title" dir="auto"><svg data-component="Octicon" class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>Important</p><p dir="auto">For communication-compute overlap to be effective on TPUs, you must enable the following XLA flags before running:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export XLA_FLAGS=&quot;--xla_tpu_enable_async_all_to_all=true --xla_tpu_overlap_compute_collective_tc=true&quot;"><pre><span class="pl-k">export</span> XLA_FLAGS=<span class="pl-s"><span class="pl-pds">"</span>--xla_tpu_enable_async_all_to_all=true --xla_tpu_overlap_compute_collective_tc=true<span class="pl-pds">"</span></span></pre></div>
</div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Caching Mechanisms</h3><a id="user-content-caching-mechanisms" class="anchor" aria-label="Permalink: Caching Mechanisms" href="#caching-mechanisms"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Wan 2.x pipelines support several caching strategies to accelerate inference by skipping redundant transformer forward passes. These are <strong>mutually exclusive</strong> — enable only one at a time.</p>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Cache Type</th>
<th>Config Flag</th>
<th>Supported Pipelines</th>
<th>Speedup</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>CFG Cache</strong></td>
<td><code>use_cfg_cache: True</code></td>
<td>Wan 2.1 T2V, Wan 2.2 T2V/I2V</td>
<td>~1.2x</td>
<td>FasterCache-style: caches the unconditional branch and applies FFT frequency-domain compensation on skipped steps.</td>
</tr>
<tr>
<td><strong>SenCache</strong></td>
<td><code>use_sen_cache: True</code></td>
<td>Wan 2.2 T2V/I2V</td>
<td>~1.4x</td>
<td>Sensitivity-Aware Caching (<a href="https://arxiv.org/abs/2602.24208" rel="nofollow">arXiv:2602.24208</a>): predicts output change via first-order sensitivity S = α_x·‖Δx‖ + α_t·|Δt|. Skips the full CFG forward pass when predicted change is below tolerance ε.</td>
</tr>
<tr>
<td><strong>MagCache</strong></td>
<td><code>use_magcache: True</code></td>
<td>Wan 2.1 T2V, Wan 2.2 T2V/I2V</td>
<td>~1.75–1.9x</td>
<td><a href="https://github.com/Zehong-Ma/MagCache">MagCache</a>: skips the transformer blocks and reuses the cached block residual when the accumulated magnitude-ratio error stays below <code>magcache_thresh</code>, capped at <code>magcache_K</code> consecutive skips. Uses a precalibrated per-step <code>mag_ratios_base</code> curve, so the skip schedule is deterministic (no data-dependent control flow).</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto">For Wan 2.2 (dual-transformer), MagCache uses a single <code>mag_ratios_base</code> curve across both phases, forces a full recompute for the first <code>retention_ratio</code> fraction of each phase, and resets the cached residual at the high→low boundary. The shipped curves are seeded from the official Wan2.2 values (<code>base_wan_27b.yml</code> for T2V, <code>base_wan_i2v_27b.yml</code> for I2V); recalibrate for your dtype/attention kernel to tighten the quality gap.</p>
<blockquote>
<p dir="auto"><strong>Wan 2.2 T2V requires <code>flow_shift=12.0</code></strong> — it sets where the high→low boundary lands, which is what <code>mag_ratios_base</code> is calibrated against. A lower shift (e.g. <code>5.0</code>) moves the boundary out of phase, so MagCache skips at the wrong steps and quality drops.</p>
</blockquote>
<p dir="auto">Benchmarks (7x, A14B, 720×1280, 81 frames, 40 steps, vs dense — SSIM/PSNR largely reflect trajectory divergence, not visible degradation):</p>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Variant</th>
<th>Settings</th>
<th>Speedup</th>
<th>SSIM / PSNR</th>
</tr>
</thead>
<tbody>
<tr>
<td>T2V</td>
<td><code>flow_shift=12.0</code>, <code>magcache_thresh=0.04</code>, <code>magcache_K=2</code></td>
<td>~1.82× (18/40 skipped)</td>
<td>0.72 / 21.8 dB</td>
</tr>
<tr>
<td>I2V</td>
<td><code>flow_shift=5.0</code>, <code>boundary_ratio=0.900</code>, <code>magcache_thresh=0.06</code>, <code>magcache_K=2</code></td>
<td>~1.75× (17/40 skipped)</td>
<td>0.91 / 25.4 dB</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto">To enable a caching mechanism, set the corresponding flag in your config YAML or pass it as a command-line override:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Example: enable SenCache for Wan 2.2 T2V
python src/maxdiffusion/generate_wan.py \
  src/maxdiffusion/configs/base_wan_27b.yml \
  use_sen_cache=True \
  ...

# Example: enable CFG Cache for Wan 2.2 I2V
python src/maxdiffusion/generate_wan.py \
  src/maxdiffusion/configs/base_wan_i2v_27b.yml \
  use_cfg_cache=True \
  ...

# Example: enable MagCache for Wan 2.2 T2V
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_27b.yml \
use_magcache=True \
magcache_thresh=0.04 \
magcache_K=2 \
...

# Example: enable MagCache for Wan 2.2 I2V
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
use_magcache=True \
magcache_thresh=0.06 \
magcache_K=2 \
..."><pre><span class="pl-c"><span class="pl-c">#</span> Example: enable SenCache for Wan 2.2 T2V</span>
python src/maxdiffusion/generate_wan.py \
  src/maxdiffusion/configs/base_wan_27b.yml \
  use_sen_cache=True \
  ...

<span class="pl-c"><span class="pl-c">#</span> Example: enable CFG Cache for Wan 2.2 I2V</span>
python src/maxdiffusion/generate_wan.py \
  src/maxdiffusion/configs/base_wan_i2v_27b.yml \
  use_cfg_cache=True \
  ...

<span class="pl-c"><span class="pl-c">#</span> Example: enable MagCache for Wan 2.2 T2V</span>
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_27b.yml \
use_magcache=True \
magcache_thresh=0.04 \
magcache_K=2 \
...

<span class="pl-c"><span class="pl-c">#</span> Example: enable MagCache for Wan 2.2 I2V</span>
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
use_magcache=True \
magcache_thresh=0.06 \
magcache_K=2 \
...</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Ring Attention</h3><a id="user-content-ring-attention" class="anchor" aria-label="Permalink: Ring Attention" href="#ring-attention"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">We added ring attention support for Wan models. Below are the stats for one <code>720p</code> (81 frames) video generation (with CFG DP):</p>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Accelerator</th>
<th>Model</th>
<th>Attention Type</th>
<th>Inference Steps</th>
<th>Sharding</th>
<th>e2e Generation Time</th>
</tr>
</thead>
<tbody>
<tr>
<td>v7x-8</td>
<td>WAN 2.1</td>
<td>Tokamax Flash</td>
<td>50</td>
<td>dp2-fsdp1-context4-tp1</td>
<td><strong>249.3</strong></td>
</tr>
<tr>
<td>v7x-8</td>
<td>WAN 2.1</td>
<td>Tokamax Ring</td>
<td>50</td>
<td>dp2-fsdp1-context4-tp1</td>
<td>252.4</td>
</tr>
<tr>
<td>v7x-8</td>
<td>WAN 2.2</td>
<td>Tokamax Flash</td>
<td>40</td>
<td>dp2-fsdp1-context4-tp1</td>
<td><strong>194.4</strong></td>
</tr>
<tr>
<td>v7x-8</td>
<td>WAN 2.2</td>
<td>Tokamax Ring</td>
<td>40</td>
<td>dp2-fsdp1-context4-tp1</td>
<td>201.7</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Accelerator</th>
<th>Model</th>
<th>Attention Type</th>
<th>Inference Steps</th>
<th>Sharding</th>
<th>e2e Generation Time</th>
</tr>
</thead>
<tbody>
<tr>
<td>v7x-16</td>
<td>WAN 2.1</td>
<td>Tokamax Flash</td>
<td>50</td>
<td>dp2-fsdp1-context8-tp1</td>
<td><strong>127.1</strong></td>
</tr>
<tr>
<td>v7x-16</td>
<td>WAN 2.1</td>
<td>Tokamax Ring</td>
<td>50</td>
<td>dp2-fsdp1-context8-tp1</td>
<td>137.2</td>
</tr>
<tr>
<td>v7x-16</td>
<td>WAN 2.2</td>
<td>Tokamax Flash</td>
<td>40</td>
<td>dp2-fsdp1-context8-tp1</td>
<td><strong>106.0</strong></td>
</tr>
<tr>
<td>v7x-16</td>
<td>WAN 2.2</td>
<td>Tokamax Ring</td>
<td>40</td>
<td>dp2-fsdp1-context8-tp1</td>
<td>137.5</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto">(* There are some known stability issues for ring attention on 16 TPUs, please use <code>tokamax_flash</code> attention instead.)</p>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Automatic Tile-Size Search</h3><a id="user-content-automatic-tile-size-search" class="anchor" aria-label="Permalink: Automatic Tile-Size Search" href="#automatic-tile-size-search"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">The optimal attention tile sizes (<code>block_q</code> / <code>block_kv</code>) depend on the sequence length, VMEM, sharding, and accelerator, and the feasibility edge is a VMEM OOM with no clean closed form — so we tune them empirically. Passing <code>enable_tile_search=true</code> to <code>generate_wan.py</code> runs a fast one-DiT-block grid search before inference and injects the winning block sizes into <code>flash_block_sizes</code> (<code>tile_search_mode=smart</code> by default; the search is opt-in and off by default).  The core is model-agnostic (<code>utils/tile_size_grid_search.py</code>) with a per-model plug (<code>utils/wan_block_benchmark.py</code>), which also runs standalone via <code>python -m maxdiffusion.utils.wan_block_benchmark ... --smart-search</code>.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Flux</h2><a id="user-content-flux" class="anchor" aria-label="Permalink: Flux" href="#flux"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">First make sure you have permissions to access the Flux repos in Huggingface.</p>
<p dir="auto">Expected results on 1024 x 1024 images with flash attention and bfloat16:</p>
<markdown-accessiblity-table><table>
<thead>
<tr>
<th>Model</th>
<th>Accelerator</th>
<th>Sharding Strategy</th>
<th>Batch Size</th>
<th>Steps</th>
<th>time (secs)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Flux-dev</td>
<td>v4-8</td>
<td>DDP</td>
<td>4</td>
<td>28</td>
<td>23</td>
</tr>
<tr>
<td>Flux-schnell</td>
<td>v4-8</td>
<td>DDP</td>
<td>4</td>
<td>4</td>
<td>2.2</td>
</tr>
<tr>
<td>Flux-dev</td>
<td>v6e-4</td>
<td>DDP</td>
<td>4</td>
<td>28</td>
<td>5.5</td>
</tr>
<tr>
<td>Flux-schnell</td>
<td>v6e-4</td>
<td>DDP</td>
<td>4</td>
<td>4</td>
<td>0.8</td>
</tr>
<tr>
<td>Flux-schnell</td>
<td>v6e-4</td>
<td>FSDP</td>
<td>4</td>
<td>4</td>
<td>1.2</td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto">Schnell:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=&quot;photograph of an electronics chip in the shape of a race car with trillium written on its side&quot; per_device_batch_size=1"><pre>python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">"</span>photograph of an electronics chip in the shape of a race car with trillium written on its side<span class="pl-pds">"</span></span> per_device_batch_size=1</pre></div>
<p dir="auto">Dev:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=&quot;photograph of an electronics chip in the shape of a race car with trillium written on its side&quot; per_device_batch_size=1"><pre>python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">"</span>photograph of an electronics chip in the shape of a race car with trillium written on its side<span class="pl-pds">"</span></span> per_device_batch_size=1</pre></div>
<p dir="auto">If you are using a TPU v6e (Trillium), you can use optimized flash block sizes for faster inference. Uncomment Flux-dev <a href="/AI-Hypercomputer/maxdiffusion/blob/main/src/maxdiffusion/configs/base_flux_dev.yml#60">config</a> and Flux-schnell <a href="/AI-Hypercomputer/maxdiffusion/blob/main/src/maxdiffusion/configs/base_flux_schnell.yml#68">config</a></p>
<p dir="auto">To keep text encoders, vae and transformer on HBM memory at all times, the following command shards the model across devices.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=&quot;photograph of an electronics chip in the shape of a race car with trillium written on its side&quot; per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False"><pre>python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">"</span>photograph of an electronics chip in the shape of a race car with trillium written on its side<span class="pl-pds">"</span></span> per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Flux.2-Klein (4B &amp; 9B)</h3><a id="user-content-flux2-klein-4b--9b" class="anchor" aria-label="Permalink: Flux.2-Klein (4B &amp; 9B)" href="#flux2-klein-4b--9b"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Flux.2-Klein provides ultra-fast 4-step image generation using Qwen3 text embeddings and FLUX.2 transformer blocks.</p>
<div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Text-to-Image Generation:</h4><a id="user-content-text-to-image-generation" class="anchor" aria-label="Permalink: Text-to-Image Generation:" href="#text-to-image-generation"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Flux.2-Klein 4B:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein.yml run_name=flux2klein_4b prompt=&quot;A detailed vector illustration of a robotic hummingbird&quot;"><pre>python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein.yml run_name=flux2klein_4b prompt=<span class="pl-s"><span class="pl-pds">"</span>A detailed vector illustration of a robotic hummingbird<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Flux.2-Klein 9B:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b prompt=&quot;A detailed vector illustration of a robotic hummingbird&quot;"><pre>python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b prompt=<span class="pl-s"><span class="pl-pds">"</span>A detailed vector illustration of a robotic hummingbird<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Multi-Reference Image Editing:</h4><a id="user-content-multi-reference-image-editing" class="anchor" aria-label="Permalink: Multi-Reference Image Editing:" href="#multi-reference-image-editing"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Flux.2-Klein supports multi-reference image editing conditioned on up to 4 reference images via the <code>image_paths</code> CLI flag.</p>
<p dir="auto">Flux.2-Klein 9B Image Editing:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_image_edit prompt=&quot;change the lighting to evening&quot; image_paths=&quot;['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']&quot;"><pre>python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_image_edit prompt=<span class="pl-s"><span class="pl-pds">"</span>change the lighting to evening<span class="pl-pds">"</span></span> image_paths=<span class="pl-s"><span class="pl-pds">"</span>['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">The 9B model also supports KV-Cache for faster inference, and can be toggled with the <code>use_kv=True</code> CLI flag:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_kv_edit prompt=&quot;change the lighting to evening&quot; image_paths=&quot;['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']&quot; use_kv=True"><pre>python src/maxdiffusion/generate_flux2klein.py src/maxdiffusion/configs/base_flux2klein_9B.yml run_name=flux2klein_9b_kv_edit prompt=<span class="pl-s"><span class="pl-pds">"</span>change the lighting to evening<span class="pl-pds">"</span></span> image_paths=<span class="pl-s"><span class="pl-pds">"</span>['src/maxdiffusion/tests/images/flux2klein/ref_flux2klein_9b.png']<span class="pl-pds">"</span></span> use_kv=True</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Fused Attention for GPU:</h2><a id="user-content-fused-attention-for-gpu" class="anchor" aria-label="Permalink: Fused Attention for GPU:" href="#fused-attention-for-gpu"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Fused Attention for GPU is supported via TransformerEngine. Installation instructions:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="cd maxdiffusion
pip install -U &quot;jax[cuda12]&quot;
pip install -r requirements.txt
pip install --upgrade torch torchvision
pip install &quot;transformer_engine[jax]
pip install ."><pre><span class="pl-c1">cd</span> maxdiffusion
pip install -U <span class="pl-s"><span class="pl-pds">"</span>jax[cuda12]<span class="pl-pds">"</span></span>
pip install -r requirements.txt
pip install --upgrade torch torchvision
pip install <span class="pl-s"><span class="pl-pds">"</span>transformer_engine[jax]</span>
<span class="pl-s">pip install .</span></pre></div>
<p dir="auto">Now run the command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="NVTE_FUSED_ATTN=1 HF_HUB_ENABLE_HF_TRANSFER=1 python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 split_head_dim=True per_device_batch_size=1 attention=&quot;cudnn_flash_te&quot; hardware=gpu"><pre>NVTE_FUSED_ATTN=1 HF_HUB_ENABLE_HF_TRANSFER=1 python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">'</span>A cute corgi lives in a house made out of sushi, anime<span class="pl-pds">'</span></span> num_inference_steps=28 split_head_dim=True per_device_batch_size=1 attention=<span class="pl-s"><span class="pl-pds">"</span>cudnn_flash_te<span class="pl-pds">"</span></span> hardware=gpu</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Wan LoRA</h2><a id="user-content-wan-lora" class="anchor" aria-label="Permalink: Wan LoRA" href="#wan-lora"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Disclaimer: not all LoRA formats have been tested. Currently supports ComfyUI and AI Toolkit formats. If there is a specific LoRA that doesn't load, please let us know.</p>
<p dir="auto">First create a copy of the relevant config file eg: <code>src/maxdiffusion/configs/base_wan_{*}.yml</code>. Update the prompt and LoRA details in the config. Make sure to set <code>enable_lora: True</code>. Then run the following command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=&quot;--xla_tpu_enable_async_collective_fusion=true \
--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true \
--xla_tpu_enable_async_collective_fusion_multiple_steps=true \
--xla_tpu_overlap_compute_collective_tc=true \
--xla_enable_async_all_reduce=true&quot; \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_14b.yml \   # --&gt; Change to your copy
jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \
per_device_batch_size=.125 \
ici_data_parallelism=2 \
ici_context_parallelism=2 \
run_name=wan-lora-inference-testing-720p \
output_dir=gs:/jfacevedo-maxdiffusion \
seed=118445 \
enable_lora=True \"><pre>HF_HUB_CACHE=/mnt/disks/external_disk/maxdiffusion_hf_cache/ \
LIBTPU_INIT_ARGS=<span class="pl-s"><span class="pl-pds">"</span>--xla_tpu_enable_async_collective_fusion=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_fuse_all_reduce=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_enable_async_collective_fusion_multiple_steps=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_tpu_overlap_compute_collective_tc=true <span class="pl-cce">\</span></span>
<span class="pl-s">--xla_enable_async_all_reduce=true<span class="pl-pds">"</span></span> \
HF_HUB_ENABLE_HF_TRANSFER=1 \
python src/maxdiffusion/generate_wan.py \
src/maxdiffusion/configs/base_wan_i2v_14b.yml <span class="pl-cce">\ </span>  <span class="pl-c"><span class="pl-c">#</span> --&gt; Change to your copy</span>
jax_cache_dir=gs://jfacevedo-maxdiffusion/jax_cache/ \
per_device_batch_size=.125 \
ici_data_parallelism=2 \
ici_context_parallelism=2 \
run_name=wan-lora-inference-testing-720p \
output_dir=gs:/jfacevedo-maxdiffusion \
seed=118445 \
enable_lora=True \</pre></div>
<p dir="auto">Loading multiple LoRAs is supported as well.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Flux LoRA</h2><a id="user-content-flux-lora" class="anchor" aria-label="Permalink: Flux LoRA" href="#flux-lora"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Disclaimer: not all LoRA formats have been tested. If there is a specific LoRA that doesn't load, please let us know.</p>
<p dir="auto">Tested with <a href="https://civitai.com/models/652699/amateur-photography-flux-dev" rel="nofollow">Amateur Photography</a> and <a href="https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main" rel="nofollow">XLabs-AI</a> LoRA collection.</p>
<p dir="auto">First download the LoRA file to a local directory, for example, <code>/home/jfacevedo/anime_lora.safetensors</code>. Then run as follows:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{&quot;lora_model_name_or_path&quot; : [&quot;/home/jfacevedo/anime_lora.safetensors&quot;], &quot;weight_name&quot; : [&quot;anime_lora.safetensors&quot;], &quot;adapter_name&quot; : [&quot;anime&quot;], &quot;scale&quot;: [0.8], &quot;from_pt&quot;: [&quot;true&quot;]}'"><pre>python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">'</span>A cute corgi lives in a house made out of sushi, anime<span class="pl-pds">'</span></span> num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config=<span class="pl-s"><span class="pl-pds">'</span>{"lora_model_name_or_path" : ["/home/jfacevedo/anime_lora.safetensors"], "weight_name" : ["anime_lora.safetensors"], "adapter_name" : ["anime"], "scale": [0.8], "from_pt": ["true"]}<span class="pl-pds">'</span></span></pre></div>
<p dir="auto">Loading multiple LoRAs is supported as follows:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{&quot;lora_model_name_or_path&quot; : [&quot;/home/jfacevedo/anime_lora.safetensors&quot;, &quot;/home/jfacevedo/amateurphoto-v6-forcu.safetensors&quot;], &quot;weight_name&quot; : [&quot;anime_lora.safetensors&quot;,&quot;amateurphoto-v6-forcu.safetensors&quot;], &quot;adapter_name&quot; : [&quot;anime&quot;,&quot;realistic&quot;], &quot;scale&quot;: [0.6, 0.6], &quot;from_pt&quot;: [&quot;true&quot;,&quot;true&quot;]}'"><pre>python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt=<span class="pl-s"><span class="pl-pds">'</span>A cute corgi lives in a house made out of sushi, anime<span class="pl-pds">'</span></span> num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config=<span class="pl-s"><span class="pl-pds">'</span>{"lora_model_name_or_path" : ["/home/jfacevedo/anime_lora.safetensors", "/home/jfacevedo/amateurphoto-v6-forcu.safetensors"], "weight_name" : ["anime_lora.safetensors","amateurphoto-v6-forcu.safetensors"], "adapter_name" : ["anime","realistic"], "scale": [0.6, 0.6], "from_pt": ["true","true"]}<span class="pl-pds">'</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Hyper SDXL LoRA</h2><a id="user-content-hyper-sdxl-lora" class="anchor" aria-label="Permalink: Hyper SDXL LoRA" href="#hyper-sdxl-lora"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Supports Hyper-SDXL models from <a href="https://huggingface.co/ByteDance/Hyper-SD" rel="nofollow">ByteDance</a></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=&quot;test-lora&quot; output_dir=/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=2 do_classifier_free_guidance=False prompt=&quot;a photograph of a cat wearing a hat riding a skateboard in a park.&quot; per_device_batch_size=1 pretrained_model_name_or_path=&quot;Lykon/AAM_XL_AnimeMix&quot; from_pt=True revision=main diffusion_scheduler_config='{&quot;_class_name&quot; : &quot;FlaxDDIMScheduler&quot;, &quot;timestep_spacing&quot; : &quot;trailing&quot;}' lora_config='{&quot;lora_model_name_or_path&quot; : [&quot;ByteDance/Hyper-SD&quot;], &quot;weight_name&quot; : [&quot;Hyper-SDXL-2steps-lora.safetensors&quot;], &quot;adapter_name&quot; : [&quot;hyper-sdxl&quot;], &quot;scale&quot;: [0.7], &quot;from_pt&quot;: [&quot;true&quot;]}'"><pre>python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>test-lora<span class="pl-pds">"</span></span> output_dir=/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=2 do_classifier_free_guidance=False prompt=<span class="pl-s"><span class="pl-pds">"</span>a photograph of a cat wearing a hat riding a skateboard in a park.<span class="pl-pds">"</span></span> per_device_batch_size=1 pretrained_model_name_or_path=<span class="pl-s"><span class="pl-pds">"</span>Lykon/AAM_XL_AnimeMix<span class="pl-pds">"</span></span> from_pt=True revision=main diffusion_scheduler_config=<span class="pl-s"><span class="pl-pds">'</span>{"_class_name" : "FlaxDDIMScheduler", "timestep_spacing" : "trailing"}<span class="pl-pds">'</span></span> lora_config=<span class="pl-s"><span class="pl-pds">'</span>{"lora_model_name_or_path" : ["ByteDance/Hyper-SD"], "weight_name" : ["Hyper-SDXL-2steps-lora.safetensors"], "adapter_name" : ["hyper-sdxl"], "scale": [0.7], "from_pt": ["true"]}<span class="pl-pds">'</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Load Multiple LoRA</h2><a id="user-content-load-multiple-lora" class="anchor" aria-label="Permalink: Load Multiple LoRA" href="#load-multiple-lora"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Supports loading multiple LoRAs for inference. Both from local or from HuggingFace hub.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=&quot;test-lora&quot; output_dir=/tmp/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=30 do_classifier_free_guidance=True prompt=&quot;ultra detailed diagram blueprint of a papercut Sitting MaineCoon cat, wide canvas, ampereart, electrical diagram, bl3uprint, papercut&quot; per_device_batch_size=1 diffusion_scheduler_config='{&quot;_class_name&quot; : &quot;FlaxDDIMScheduler&quot;, &quot;timestep_spacing&quot; : &quot;trailing&quot;}' lora_config='{&quot;lora_model_name_or_path&quot; : [&quot;/home/jfacevedo/blueprintify-sd-xl-10.safetensors&quot;,&quot;TheLastBen/Papercut_SDXL&quot;], &quot;weight_name&quot; : [&quot;/home/jfacevedo/blueprintify-sd-xl-10.safetensors&quot;,&quot;papercut.safetensors&quot;], &quot;adapter_name&quot; : [&quot;blueprint&quot;,&quot;papercut&quot;], &quot;scale&quot;: [0.8, 0.7], &quot;from_pt&quot;: [&quot;true&quot;, &quot;true&quot;]}'"><pre>python src/maxdiffusion/generate_sdxl.py src/maxdiffusion/configs/base_xl.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>test-lora<span class="pl-pds">"</span></span> output_dir=/tmp/tmp/ jax_cache_dir=/tmp/cache_dir/ num_inference_steps=30 do_classifier_free_guidance=True prompt=<span class="pl-s"><span class="pl-pds">"</span>ultra detailed diagram blueprint of a papercut Sitting MaineCoon cat, wide canvas, ampereart, electrical diagram, bl3uprint, papercut<span class="pl-pds">"</span></span> per_device_batch_size=1 diffusion_scheduler_config=<span class="pl-s"><span class="pl-pds">'</span>{"_class_name" : "FlaxDDIMScheduler", "timestep_spacing" : "trailing"}<span class="pl-pds">'</span></span> lora_config=<span class="pl-s"><span class="pl-pds">'</span>{"lora_model_name_or_path" : ["/home/jfacevedo/blueprintify-sd-xl-10.safetensors","TheLastBen/Papercut_SDXL"], "weight_name" : ["/home/jfacevedo/blueprintify-sd-xl-10.safetensors","papercut.safetensors"], "adapter_name" : ["blueprint","papercut"], "scale": [0.8, 0.7], "from_pt": ["true", "true"]}<span class="pl-pds">'</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">SDXL Lightning</h2><a id="user-content-sdxl-lightning" class="anchor" aria-label="Permalink: SDXL Lightning" href="#sdxl-lightning"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Single and Multi host inference is supported with sharding annotations:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl_lightning.yml run_name=&quot;my_run&quot; lightning_repo=&quot;ByteDance/SDXL-Lightning&quot; lightning_ckpt=&quot;sdxl_lightning_4step_unet.safetensors&quot;"><pre>python -m src.maxdiffusion.generate_sdxl src/maxdiffusion/configs/base_xl_lightning.yml run_name=<span class="pl-s"><span class="pl-pds">"</span>my_run<span class="pl-pds">"</span></span> lightning_repo=<span class="pl-s"><span class="pl-pds">"</span>ByteDance/SDXL-Lightning<span class="pl-pds">"</span></span> lightning_ckpt=<span class="pl-s"><span class="pl-pds">"</span>sdxl_lightning_4step_unet.safetensors<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">ControlNet</h2><a id="user-content-controlnet" class="anchor" aria-label="Permalink: ControlNet" href="#controlnet"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Might require installing extra libraries for opencv: <code>apt-get update &amp;&amp; apt-get install ffmpeg libsm6 libxext6  -y</code></p>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion 1.4</h3><a id="user-content-stable-diffusion-14" class="anchor" aria-label="Permalink: Stable Diffusion 1.4" href="#stable-diffusion-14"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/controlnet/generate_controlnet_replicated.py"><pre>python src/maxdiffusion/controlnet/generate_controlnet_replicated.py</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Stable Diffusion XL</h3><a id="user-content-stable-diffusion-xl-1" class="anchor" aria-label="Permalink: Stable Diffusion XL" href="#stable-diffusion-xl-1"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python src/maxdiffusion/controlnet/generate_controlnet_sdxl_replicated.py"><pre>python src/maxdiffusion/controlnet/generate_controlnet_sdxl_replicated.py</pre></div>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Getting Started: Multihost development</h2><a id="user-content-getting-started-multihost-development" class="anchor" aria-label="Permalink: Getting Started: Multihost development" href="#getting-started-multihost-development"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Multihost training for Stable Diffusion 2 base can be run using the following command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TPU_NAME=&lt;your-tpu-name&gt;
ZONE=&lt;your-zone&gt;
PROJECT_ID=&lt;your-project-id&gt;
gcloud compute tpus tpu-vm ssh $TPU_NAME --zone=$ZONE --project $PROJECT_ID --worker=all --command=&quot;
export LIBTPU_INIT_ARGS=&quot;&quot;
git clone https://github.com/google/maxdiffusion
cd maxdiffusion
pip3 install jax[tpu] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
pip3 install -r requirements.txt
pip3 install .
python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=my_run output_dir=gs://your-bucket/&quot;"><pre>TPU_NAME=<span class="pl-k">&lt;</span>your-tpu-name<span class="pl-k">&gt;</span>
ZONE=<span class="pl-k">&lt;</span>your-zone<span class="pl-k">&gt;</span>
PROJECT_ID=<span class="pl-k">&lt;</span>your-project-id<span class="pl-k">&gt;</span>
gcloud compute tpus tpu-vm ssh <span class="pl-smi">$TPU_NAME</span> --zone=<span class="pl-smi">$ZONE</span> --project <span class="pl-smi">$PROJECT_ID</span> --worker=all --command=<span class="pl-s"><span class="pl-pds">"</span></span>
<span class="pl-s">export LIBTPU_INIT_ARGS=<span class="pl-pds">"</span><span class="pl-pds">"</span></span>
<span class="pl-s">git clone https://github.com/google/maxdiffusion</span>
<span class="pl-s">cd maxdiffusion</span>
<span class="pl-s">pip3 install jax[tpu] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html</span>
<span class="pl-s">pip3 install -r requirements.txt</span>
<span class="pl-s">pip3 install .</span>
<span class="pl-s">python -m src.maxdiffusion.train src/maxdiffusion/configs/base_2_base.yml run_name=my_run output_dir=gs://your-bucket/<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Comparison to Alternatives</h1><a id="user-content-comparison-to-alternatives" class="anchor" aria-label="Permalink: Comparison to Alternatives" href="#comparison-to-alternatives"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">MaxDiffusion started as a fork of <a href="https://github.com/huggingface/diffusers">Diffusers</a>, a Hugging Face diffusion library written in Python, Pytorch and Jax. MaxDiffusion is compatible with Hugging Face Jax models. MaxDiffusion is more complex and was designed to run distributed across TPU Pods.</p>
<div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Development</h1><a id="user-content-development" class="anchor" aria-label="Permalink: Development" href="#development"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Whether you are forking MaxDiffusion for your own needs or intending to contribute back to the community, a full suite of tests can be found in <code>tests</code> and <code>src/maxdiffusion/tests</code>.</p>
<p dir="auto">To run unit tests simply run:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python -m pytest"><pre>python -m pytest</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Pre-commit Hooks</h3><a id="user-content-pre-commit-hooks" class="anchor" aria-label="Permalink: Pre-commit Hooks" href="#pre-commit-hooks"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">We use <a href="https://pre-commit.com/" rel="nofollow">pre-commit</a> to automatically check and format code before each commit (using <code>pyink</code>, <code>ruff</code>, <code>pylint</code>, and general git hygiene checks).</p>
<blockquote>
<p dir="auto"><strong>Important:</strong> Make sure you are in your active virtual environment (e.g. <code>maxdiffusion_venv</code> or your active venv) before running <code>pre-commit install</code>, so that hooks run using the environment's installed dependencies.</p>
</blockquote>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# 1. Activate your virtual environment first
source &lt;path-to-venv&gt;/bin/activate

# 2. Install pre-commit (if not already installed)
pip install pre-commit

# 3. Install git pre-commit hooks
pre-commit install"><pre><span class="pl-c"><span class="pl-c">#</span> 1. Activate your virtual environment first</span>
<span class="pl-c1">source</span> <span class="pl-k">&lt;</span>path-to-venv<span class="pl-k">&gt;</span>/bin/activate

<span class="pl-c"><span class="pl-c">#</span> 2. Install pre-commit (if not already installed)</span>
pip install pre-commit

<span class="pl-c"><span class="pl-c">#</span> 3. Install git pre-commit hooks</span>
pre-commit install</pre></div>
<p dir="auto">Once installed, pre-commit will automatically run on staged files whenever you run <code>git commit</code>.</p>
<p dir="auto">You can also run all pre-commit checks manually across the entire repository at any time:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pre-commit run --all-files"><pre>pre-commit run --all-files</pre></div>
<div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Code Style</h3><a id="user-content-code-style" class="anchor" aria-label="Permalink: Code Style" href="#code-style"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">This project uses <code>pylint</code> and <code>pyink</code> to enforce code style. Before submitting a pull request, please ensure your code passes these checks by running:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="bash code_style.sh"><pre>bash code_style.sh</pre></div>
<p dir="auto">This script will automatically format your code with <code>pyink</code> and help you identify any remaining style issues.</p>
<p dir="auto">The full suite of -end-to end tests is in <code>tests</code> and <code>src/maxdiffusion/tests</code>. We run them with a nightly cadance.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Profiling</h2><a id="user-content-profiling" class="anchor" aria-label="Permalink: Profiling" href="#profiling"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">To learn how to enable ML Diagnostics and XProf profiling for your runs, please see our <a href="/AI-Hypercomputer/maxdiffusion/blob/main/docs/profiling.md">ML Diagnostics Guide</a>.</p>
<div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Metrics</h2><a id="user-content-metrics" class="anchor" aria-label="Permalink: Metrics" href="#metrics"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">To learn how to enable ML Diagnostics metrics tracking for your runs, please see our <a href="/AI-Hypercomputer/maxdiffusion/blob/main/docs/metrics.md">Metrics Guide</a>.</p>
</article></div><div class="d-none"></div></section></div></div></div> </div> <!-- --> </div></div></div></div></div></div><div class="ScrollMarksContainer-module__scrollMarksContainer__Eu7uU" id="find-result-marks-container"></div><div class="d-none"></div><div class="d-none"></div></div> <!-- --> <!-- --> </div>
</react-app>




  </div>

</turbo-frame>

    </main>
  </div>

  </div>

          <footer class="footer f6 color-fg-muted color-border-subtle tmp-pt-7 tmp-pb-6 p-responsive" role="contentinfo"  >
  <h2 class='sr-only'>Footer</h2>

  


  <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap">
    <div class="d-flex flex-items-center flex-shrink-0 mx-2">
      <a aria-label="GitHub Homepage" class="footer-octicon mr-2" href="https://github.com">
        <svg aria-hidden="true" data-component="Octicon" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github">
    <path d="M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"></path>
</svg>
</a>
      <span>
        &copy; 2026 GitHub,&nbsp;Inc.
      </span>
    </div>

    <nav aria-label="Footer">
      <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3>

      <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading">


          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a>
          </li>


            <li class="mx-2">
              <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a>
            </li>

            <li class="mx-2">
              <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a>
            </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to community&quot;,&quot;label&quot;:&quot;text:community&quot;}" href="https://github.community/" data-view-component="true" class="Link--secondary Link">Community</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a>
          </li>

          
<li class="mx-2" >
  <cookie-consent-link>
    <button
      type="button"
      class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent"
      data-action="click:cookie-consent-link#showConsentManagement"
      data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}"
    >
      Manage cookies
    </button>
  </cookie-consent-link>
</li>

  <li class="mx-2">
    <cookie-consent-link>
      <button
        type="button"
        class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent text-left"
        data-action="click:cookie-consent-link#showConsentManagement"
        data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}"
      >
        Do not share my personal information
      </button>
    </cookie-consent-link>
  </li>

      </ul>
    </nav>
  </div>
</footer>



    <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999"
      data-locale="en"
      data-initial-cookie-consent-allowed=""
      data-cookie-consent-required="true"
    ></ghcc-consent>




  <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden>
    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
    </button>
    You can’t perform that action at this time.
  </div>

    <template id="site-details-dialog">
  <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open>
    <summary role="button" aria-label="Close dialog"></summary>
    <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal">
      <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog>
        <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
      </button>
      <div class="octocat-spinner tmp-my-6 js-details-dialog-spinner"></div>
    </details-dialog>
  </details>
</template>

    <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;">
  <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;">
  </div>
</div>

    <template id="snippet-clipboard-copy-button">
  <div class="zeroclipboard-container position-absolute right-0 top-0">
    <clipboard-copy aria-label="Copy code to clipboard" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w">
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2 tmp-m-2">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2 tmp-m-2">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
    </clipboard-copy>
  </div>
</template>
<template id="snippet-clipboard-copy-button-unpositioned">
  <div class="zeroclipboard-container">
    <clipboard-copy aria-label="Copy code to clipboard" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w">
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
    </clipboard-copy>
  </div>
</template>




    </div>
    <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div>
    <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div>
  </body>
</html>

