Jellybit

RefMod token limit calculator

Sep 8th, 2026 (edited)
54
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 29.62 KB | Software | 0 0
  1. Add-Type -AssemblyName PresentationFramework
  2. Add-Type -AssemblyName PresentationCore
  3. Add-Type -AssemblyName WindowsBase
  4. Add-Type -AssemblyName System.Windows.Forms
  5.  
  6. # --- Constants & Limits ---
  7. $script:MAX_TOKENS        = 61440
  8. $script:RECOMMENDED_LIMIT = 50.0
  9. $script:HARD_LIMIT        = 60.0
  10.  
  11. $script:TOKENS_PER_AUDIO_SEC = 128
  12. $script:ImageTokenCost       = 1024.0
  13.  
  14. function Get-ImageDimensions {
  15.     param ([string]$FilePath)
  16.     try {
  17.         $img = [System.Drawing.Image]::FromFile($FilePath)
  18.         $w = $img.Width
  19.         $h = $img.Height
  20.         $img.Dispose()
  21.         return @{ Width = $w; Height = $h }
  22.     } catch {
  23.         return $null
  24.     }
  25. }
  26.  
  27. function Update-LimitLinePosition {
  28.     if ($C.MeterBar -and $C.LimitLine) {
  29.         $barWidth = $C.MeterBar.ActualWidth
  30.         if ($barWidth -gt 0) {
  31.             $lineX = $barWidth * ($script:RECOMMENDED_LIMIT / $script:HARD_LIMIT)
  32.             $C.LimitLine.X1 = $lineX
  33.             $C.LimitLine.X2 = $lineX
  34.         }
  35.     }
  36. }
  37.  
  38. function Get-RefModVideoTokenRate {
  39.     if (-not $C.CmbVidMode -or -not $C.CmbVidMode.SelectedValue) { return 6144 }
  40.     $mode = $C.CmbVidMode.SelectedValue.Tag
  41.    
  42.     if ($mode -eq "training") {
  43.         $gridSize = [double]$C.CmbGridSize.SelectedValue.Tag
  44.         $tokensPerTemporalFrame = [math]::Pow(($gridSize / 2.0), 2)
  45.     } else {
  46.         $res = [double]$C.CmbVidRes.SelectedValue.Tag
  47.         $latentGrid = $res / 16.0
  48.         $tokensPerTemporalFrame = [math]::Pow(($latentGrid / 2.0), 2)
  49.     }
  50.  
  51.     return ($tokensPerTemporalFrame * 6.0)
  52. }
  53.  
  54. function Recalculate-Budget {
  55.     if (-not $C.SliderImages) { return }
  56.  
  57.     $w = [double]$C.TxtWidth.Text
  58.     $h = [double]$C.TxtHeight.Text
  59.     if ($w -le 0) { $w = 1024 }
  60.     if ($h -le 0) { $h = 1024 }
  61.     $script:ImageTokenCost = [math]::Max(1.0, ([math]::Ceiling($w / 32.0) * [math]::Ceiling($h / 32.0)))
  62.  
  63.     $vidRatePerSec = Get-RefModVideoTokenRate
  64.     if ($C.ChkVidHasAudio.IsChecked) {
  65.         $vidRatePerSec += $script:TOKENS_PER_AUDIO_SEC
  66.     }
  67.  
  68.     $maxImageCount = [math]::Floor($script:MAX_TOKENS / $script:ImageTokenCost)
  69.     $maxVideoSec   = [math]::Floor($script:MAX_TOKENS / [math]::Max(1.0, $vidRatePerSec))
  70.     $maxAudioSec   = [math]::Floor($script:MAX_TOKENS / $script:TOKENS_PER_AUDIO_SEC)
  71.  
  72.     $C.SliderImages.Maximum = $maxImageCount
  73.     $C.SliderVideo.Maximum  = $maxVideoSec
  74.     $C.SliderAudio.Maximum  = $maxAudioSec
  75.  
  76.     $imgCount = $C.SliderImages.Value
  77.     $vidSec   = $C.SliderVideo.Value
  78.     $audSec   = $C.SliderAudio.Value
  79.  
  80.     $usedTokens = ($imgCount * $script:ImageTokenCost) + ($vidSec * $vidRatePerSec) + ($audSec * $script:TOKENS_PER_AUDIO_SEC)
  81.     $equivalentUnits = $usedTokens / 1024.0
  82.  
  83.     $C.LblImageCount.Text = [string][int]$imgCount
  84.     $C.LblVideoSec.Text   = "$([int]$vidSec)s"
  85.     $C.LblAudioSec.Text   = "$([int]$audSec)s"
  86.  
  87.     $C.LblImgCostInfo.Text = "($([int]$script:ImageTokenCost) t/img | Max: $maxImageCount)"
  88.     $C.LblVidCostInfo.Text = "($([math]::Round($vidRatePerSec)) t/s | Max: ${maxVideoSec}s)"
  89.     $C.LblAudCostInfo.Text = "($script:TOKENS_PER_AUDIO_SEC t/s | Max: ${maxAudioSec}s)"
  90.  
  91.     $C.LblTokenUsage.Text  = "$([math]::Round($usedTokens)) / $script:MAX_TOKENS Tokens"
  92.     $C.LblMeterUnits.Text  = "{0:F1} / 60.0 Equivalent Units" -f $equivalentUnits
  93.  
  94.     $meterPct = [math]::Min(100.0, ($equivalentUnits / $script:HARD_LIMIT) * 100.0)
  95.     $C.MeterBar.Value = $meterPct
  96.  
  97.     if ($equivalentUnits -gt $script:HARD_LIMIT) {
  98.         $C.MeterBar.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FFFF4444")
  99.         $C.LblMeterStatus.Text = "OVER BUDGET"
  100.         $C.LblMeterStatus.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FFFF4444")
  101.     } elseif ($equivalentUnits -ge $script:RECOMMENDED_LIMIT) {
  102.         $C.MeterBar.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FFCCAA00")
  103.         $C.LblMeterStatus.Text = "WARNING (Near Limit)"
  104.         $C.LblMeterStatus.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FFCCAA00")
  105.     } else {
  106.         $C.MeterBar.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FF00CC66")
  107.         $C.LblMeterStatus.Text = "WITHIN BUDGET"
  108.         $C.LblMeterStatus.Foreground = [System.Windows.Media.BrushConverter]::new().ConvertFrom("#FF00CC66")
  109.     }
  110. }
  111.  
  112. function Toggle-GridVisibility {
  113.     if (-not $C.CmbVidMode -or -not $C.CmbVidMode.SelectedValue) { return }
  114.     $mode = $C.CmbVidMode.SelectedValue.Tag
  115.     if ($mode -eq "training") {
  116.         $C.PnlGridSize.Visibility = [System.Windows.Visibility]::Visible
  117.     } else {
  118.         $C.PnlGridSize.Visibility = [System.Windows.Visibility]::Collapsed
  119.     }
  120.     Recalculate-Budget
  121. }
  122.  
  123. # ===================== XAML UI =====================
  124. [xml]$xaml = @"
  125. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  126.        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  127.        xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
  128.        Title="Context Budget Calculator" Height="730" Width="800" MinWidth="740"
  129.        WindowStartupLocation="CenterScreen" AllowsTransparency="True" WindowStyle="None"
  130.        Background="Transparent" Name="MainWindow" ResizeMode="CanResize">
  131.    <Window.Resources>
  132.        <SolidColorBrush x:Key="DarkBg" Color="#FF2D2D30"/>
  133.         <SolidColorBrush x:Key="DarkHeaderBg" Color="#FF3E3E42"/>
  134.         <SolidColorBrush x:Key="BorderBrush" Color="#FF555555"/>
  135.         <SolidColorBrush x:Key="TextBrush" Color="White"/>
  136.         <SolidColorBrush x:Key="HoverBrush" Color="#FF007ACC"/>
  137.  
  138.         <!-- Custom Dropdown Item Styling -->
  139.         <Style TargetType="ComboBoxItem">
  140.             <Setter Property="Background" Value="{StaticResource DarkBg}"/>
  141.             <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
  142.             <Setter Property="Padding" Value="6,4"/>
  143.             <Setter Property="Template">
  144.                 <Setter.Value>
  145.                     <ControlTemplate TargetType="ComboBoxItem">
  146.                         <Border Name="Bd" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
  147.                             <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  148.                         </Border>
  149.                         <ControlTemplate.Triggers>
  150.                             <Trigger Property="IsMouseOver" Value="True">
  151.                                 <Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}"/>
  152.                                 <Setter Property="TextElement.Foreground" Value="White"/>
  153.                             </Trigger>
  154.                             <Trigger Property="IsSelected" Value="True">
  155.                                 <Setter TargetName="Bd" Property="Background" Value="{StaticResource DarkHeaderBg}"/>
  156.                                 <Setter Property="TextElement.Foreground" Value="White"/>
  157.                             </Trigger>
  158.                             <MultiTrigger>
  159.                                 <MultiTrigger.Conditions>
  160.                                     <Condition Property="IsSelected" Value="True"/>
  161.                                     <Condition Property="IsMouseOver" Value="True"/>
  162.                                 </MultiTrigger.Conditions>
  163.                                 <Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}"/>
  164.                                 <Setter Property="TextElement.Foreground" Value="White"/>
  165.                             </MultiTrigger>
  166.                         </ControlTemplate.Triggers>
  167.                     </ControlTemplate>
  168.                 </Setter.Value>
  169.             </Setter>
  170.         </Style>
  171.  
  172.         <!-- Custom ComboBox Control Template -->
  173.         <Style TargetType="ComboBox">
  174.             <Setter Property="Background" Value="{StaticResource DarkHeaderBg}"/>
  175.             <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
  176.             <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
  177.             <Setter Property="BorderThickness" Value="1"/>
  178.             <Setter Property="Padding" Value="6,3"/>
  179.             <Setter Property="Template">
  180.                 <Setter.Value>
  181.                     <ControlTemplate TargetType="ComboBox">
  182.                         <Grid Name="MainGrid" SnapsToDevicePixels="true">
  183.                             <Grid.ColumnDefinitions>
  184.                                 <ColumnDefinition Width="*"/>
  185.                                 <ColumnDefinition Width="20"/>
  186.                             </Grid.ColumnDefinitions>
  187.                            
  188.                             <!-- Toggle Button with Custom Hover States -->
  189.                             <ToggleButton Grid.ColumnSpan="2" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
  190.                                 <ToggleButton.Style>
  191.                                     <Style TargetType="ToggleButton">
  192.                                         <Setter Property="Background" Value="#FF3E3E42"/>
  193.                                         <Setter Property="BorderBrush" Value="#FF555555"/>
  194.                                         <Setter Property="BorderThickness" Value="1"/>
  195.                                         <Setter Property="Template">
  196.                                             <Setter.Value>
  197.                                                 <ControlTemplate TargetType="ToggleButton">
  198.                                                     <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
  199.                                                 </ControlTemplate>
  200.                                             </Setter.Value>
  201.                                         </Setter>
  202.                                         <Style.Triggers>
  203.                                             <Trigger Property="IsMouseOver" Value="True">
  204.                                                 <Setter Property="Background" Value="#FF555555"/>
  205.                                                 <Setter Property="BorderBrush" Value="#FF007ACC"/>
  206.                                             </Trigger>
  207.                                         </Style.Triggers>
  208.                                     </Style>
  209.                                 </ToggleButton.Style>
  210.                             </ToggleButton>
  211.  
  212.                             <!-- Content Presenter for Selected Item -->
  213.                             <ContentPresenter Grid.Column="0" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}">
  214.                                 <ContentPresenter.Resources>
  215.                                     <Style TargetType="TextBlock">
  216.                                         <Setter Property="Foreground" Value="White"/>
  217.                                     </Style>
  218.                                 </ContentPresenter.Resources>
  219.                             </ContentPresenter>
  220.                            
  221.                             <Path Grid.Column="1" Data="M 0 0 L 4 4 L 8 0 Z" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/>
  222.                            
  223.                             <!-- Dropdown Popup -->
  224.                             <Popup Name="PART_Popup" Grid.ColumnSpan="2" AllowsTransparency="true" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="Slide">
  225.                                 <Border Name="DropDownBorder" Background="{StaticResource DarkBg}" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}">
  226.                                     <ScrollViewer Name="DropDownScrollViewer">
  227.                                         <Grid RenderOptions.ClearTypeHint="Enabled">
  228.                                             <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
  229.                                                 <Rectangle Name="OpaqueRect" Fill="{StaticResource DarkBg}" Height="{Binding ElementName=DropDownBorder, Path=ActualHeight}" Width="{Binding ElementName=DropDownBorder, Path=ActualWidth}"/>
  230.                                             </Canvas>
  231.                                             <ItemsPresenter Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  232.                                         </Grid>
  233.                                     </ScrollViewer>
  234.                                 </Border>
  235.                             </Popup>
  236.                         </Grid>
  237.                        
  238.                         <ControlTemplate.Triggers>
  239.                             <Trigger Property="IsMouseOver" Value="True">
  240.                                 <Setter Property="Foreground" Value="White"/>
  241.                             </Trigger>
  242.                         </ControlTemplate.Triggers>
  243.                     </ControlTemplate>
  244.                 </Setter.Value>
  245.             </Setter>
  246.         </Style>
  247.     </Window.Resources>
  248.  
  249.     <shell:WindowChrome.WindowChrome>
  250.         <shell:WindowChrome CaptionHeight="30" CornerRadius="0" GlassFrameThickness="0" ResizeBorderThickness="8" UseAeroCaptionButtons="False"/>
  251.     </shell:WindowChrome.WindowChrome>
  252.  
  253.     <Border Background="#FF2D2D30" BorderBrush="#FF007ACC" BorderThickness="1">
  254.         <Grid>
  255.             <Grid.RowDefinitions>
  256.                 <RowDefinition Height="Auto"/>
  257.                 <RowDefinition Height="*"/>
  258.             </Grid.RowDefinitions>
  259.  
  260.             <!-- Title Bar -->
  261.             <Border Grid.Row="0" Background="#FF252526" Height="30">
  262.                 <Grid>
  263.                     <TextBlock Text="RefMod &amp; Context Budget Calculator" Foreground="White" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10,0,0,0"/>
  264.                     <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  265.                         <Button Name="MinimizeButton" Content="&#x2015;" Width="40" Height="30" shell:WindowChrome.IsHitTestVisibleInChrome="True">
  266.                             <Button.Style>
  267.                                 <Style TargetType="Button">
  268.                                     <Setter Property="Background" Value="Transparent"/><Setter Property="Foreground" Value="White"/><Setter Property="BorderThickness" Value="0"/>
  269.                                     <Style.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" Value="#FF555555"/></Trigger></Style.Triggers>
  270.                                 </Style>
  271.                             </Button.Style>
  272.                         </Button>
  273.                         <Button Name="CloseButton" Content="&#x2715;" Width="40" Height="30" shell:WindowChrome.IsHitTestVisibleInChrome="True">
  274.                             <Button.Style>
  275.                                 <Style TargetType="Button">
  276.                                     <Setter Property="Background" Value="Transparent"/><Setter Property="Foreground" Value="White"/><Setter Property="BorderThickness" Value="0"/>
  277.                                     <Style.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" Value="#FFE81123"/></Trigger></Style.Triggers>
  278.                                 </Style>
  279.                             </Button.Style>
  280.                         </Button>
  281.                     </StackPanel>
  282.                 </Grid>
  283.             </Border>
  284.  
  285.             <!-- Main Content -->
  286.             <Grid Grid.Row="1" Margin="20">
  287.                 <Grid.RowDefinitions>
  288.                     <RowDefinition Height="Auto"/>
  289.                     <RowDefinition Height="Auto"/>
  290.                     <RowDefinition Height="Auto"/>
  291.                     <RowDefinition Height="Auto"/>
  292.                     <RowDefinition Height="*"/>
  293.                 </Grid.RowDefinitions>
  294.  
  295.                 <!-- Meter Panel -->
  296.                 <Border Grid.Row="0" Background="#FF1E1E1E" BorderBrush="#FF555555" BorderThickness="1" CornerRadius="6" Padding="15" Margin="0,0,0,12">
  297.                     <StackPanel>
  298.                         <Grid Margin="0,0,0,8">
  299.                             <TextBlock Name="LblMeterStatus" Text="WITHIN BUDGET" Foreground="#FF00CC66" FontWeight="Bold" FontSize="14" HorizontalAlignment="Left"/>
  300.                             <TextBlock Name="LblMeterUnits" Text="0.0 / 60.0 Equivalent Units" Foreground="White" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right"/>
  301.                         </Grid>
  302.  
  303.                         <Grid Height="26">
  304.                             <ProgressBar Name="MeterBar" Minimum="0" Maximum="100" Value="0" Background="#FF3E3E42" Foreground="#FF00CC66" BorderBrush="#FF555555" BorderThickness="1"/>
  305.                             <Canvas>
  306.                                 <Line Name="LimitLine" X1="0" Y1="0" X2="0" Y2="26" Stroke="#FFCCAA00" StrokeThickness="2" StrokeDashArray="2 2"/>
  307.                             </Canvas>
  308.                             <TextBlock Name="LblTokenUsage" Text="0 / 61440 Tokens" Foreground="White" FontWeight="Bold" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  309.                         </Grid>
  310.  
  311.                         <Grid Margin="0,6,0,0">
  312.                             <Grid.ColumnDefinitions>
  313.                                 <ColumnDefinition Width="*"/>
  314.                                 <ColumnDefinition Width="Auto"/>
  315.                             </Grid.ColumnDefinitions>
  316.                             <TextBlock Text="0" Foreground="#FF888888" FontSize="10" HorizontalAlignment="Left"/>
  317.                             <TextBlock Grid.Column="0" Text="50 (Recommended)" Foreground="#FFCCAA00" FontSize="10" HorizontalAlignment="Right" Margin="0,0,50,0"/>
  318.                             <TextBlock Grid.Column="1" Text="60 (Limit)" Foreground="#FFFF4444" FontSize="10" HorizontalAlignment="Right"/>
  319.                         </Grid>
  320.                     </StackPanel>
  321.                 </Border>
  322.  
  323.                 <!-- Image Configuration -->
  324.                 <Border Grid.Row="1" Name="DropZone" Background="#FF1E1E1E" BorderBrush="#FF555555" BorderThickness="1" CornerRadius="6" Padding="10" Margin="0,0,0,12" AllowDrop="True">
  325.                     <Grid>
  326.                         <Grid.ColumnDefinitions>
  327.                             <ColumnDefinition Width="*"/>
  328.                             <ColumnDefinition Width="Auto"/>
  329.                         </Grid.ColumnDefinitions>
  330.                         <StackPanel Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,0">
  331.                             <TextBlock Text="Image Configuration &amp; Resolution Detection" Foreground="#FFBBBBBB" FontWeight="SemiBold" FontSize="12" Margin="0,0,0,6"/>
  332.                             <WrapPanel Orientation="Horizontal">
  333.                                 <Label Content="Width:" Foreground="#FFBBBBBB" VerticalAlignment="Center" Margin="0,0,2,0"/>
  334.                                 <TextBox Name="TxtWidth" Text="1024" Width="55" Height="24" Background="#FF3E3E42" Foreground="White" BorderBrush="#FF555555" Padding="3,1" VerticalContentAlignment="Center"/>
  335.                                 <Label Content="px" Foreground="#FF888888" VerticalAlignment="Center" Margin="2,0,8,0"/>
  336.  
  337.                                 <Label Content="Height:" Foreground="#FFBBBBBB" VerticalAlignment="Center" Margin="0,0,2,0"/>
  338.                                 <TextBox Name="TxtHeight" Text="1024" Width="55" Height="24" Background="#FF3E3E42" Foreground="White" BorderBrush="#FF555555" Padding="3,1" VerticalContentAlignment="Center"/>
  339.                                 <Label Content="px" Foreground="#FF888888" VerticalAlignment="Center" Margin="2,0,8,0"/>
  340.  
  341.                                 <Button Name="BtnPresetDVD" Content="DVD" Width="Auto" Padding="6,0" Height="24" Background="#FF3E3E42" Foreground="White" BorderBrush="#FF555555" Margin="0,0,4,0"/>
  342.                                 <Button Name="BtnPreset1080" Content="1080p" Width="Auto" Padding="6,0" Height="24" Background="#FF3E3E42" Foreground="White" BorderBrush="#FF555555"/>
  343.                             </WrapPanel>
  344.                         </StackPanel>
  345.  
  346.                         <Border Grid.Column="1" Width="160" Height="46" Background="#FF252540" BorderBrush="#FF007ACC" BorderThickness="1" CornerRadius="4" Padding="8,4">
  347.                             <TextBlock Text="Drag &amp; Drop Image Here&#x0a;to Detect Resolution" Foreground="#FF007ACC" FontSize="10" TextAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/>
  348.                         </Border>
  349.                     </Grid>
  350.                 </Border>
  351.  
  352.                 <!-- RefMod Video Extraction Configuration -->
  353.                 <Border Grid.Row="2" Background="#FF1E1E1E" BorderBrush="#FF555555" BorderThickness="1" CornerRadius="6" Padding="10" Margin="0,0,0,12">
  354.                     <StackPanel>
  355.                         <TextBlock Text="RefMod Video Extraction Parameters (ComfyUI-MiniMaxH3Mod)" Foreground="#FFBBBBBB" FontWeight="SemiBold" FontSize="12" Margin="0,0,0,6"/>
  356.                         <WrapPanel Orientation="Horizontal">
  357.                             <!-- Mode Selector -->
  358.                             <StackPanel Orientation="Horizontal" Margin="0,0,15,0">
  359.                                 <Label Content="Mode:" Foreground="#FFBBBBBB" VerticalAlignment="Center" Margin="0,0,2,0"/>
  360.                                 <ComboBox Name="CmbVidMode" Width="100" Height="24" VerticalContentAlignment="Center">
  361.                                     <ComboBoxItem Content="encode" Tag="encode" IsSelected="True"/>
  362.                                     <ComboBoxItem Content="training" Tag="training"/>
  363.                                 </ComboBox>
  364.                             </StackPanel>
  365.  
  366.                             <!-- Short-edge Resolution -->
  367.                             <StackPanel Orientation="Horizontal" Margin="0,0,15,0">
  368.                                 <Label Content="ref_resolution:" Foreground="#FFBBBBBB" VerticalAlignment="Center" Margin="0,0,2,0"/>
  369.                                 <ComboBox Name="CmbVidRes" Width="130" Height="24" VerticalContentAlignment="Center">
  370.                                     <ComboBoxItem Content="512px" Tag="512"/>
  371.                                     <ComboBoxItem Content="1024px (Default)" Tag="1024" IsSelected="True"/>
  372.                                     <ComboBoxItem Content="2048px (Max)" Tag="2048"/>
  373.                                 </ComboBox>
  374.                             </StackPanel>
  375.  
  376.                             <!-- Pooled Grid Size -->
  377.                             <StackPanel Name="PnlGridSize" Orientation="Horizontal" Margin="0,0,15,0" Visibility="Collapsed">
  378.                                 <Label Content="Grid Size:" Foreground="#FFBBBBBB" VerticalAlignment="Center" Margin="0,0,2,0"/>
  379.                                 <ComboBox Name="CmbGridSize" Width="120" Height="24" VerticalContentAlignment="Center">
  380.                                     <ComboBoxItem Content="8x8 (16 t/f)" Tag="8"/>
  381.                                     <ComboBoxItem Content="16x16 (64 t/f)" Tag="16" IsSelected="True"/>
  382.                                     <ComboBoxItem Content="32x32 (256 t/f)" Tag="32"/>
  383.                                     <ComboBoxItem Content="64x64 (1024 t/f)" Tag="64"/>
  384.                                 </ComboBox>
  385.                             </StackPanel>
  386.                         </WrapPanel>
  387.                     </StackPanel>
  388.                 </Border>
  389.  
  390.                 <!-- Sliders Section -->
  391.                 <StackPanel Grid.Row="3">
  392.                     <Grid Margin="0,0,0,12">
  393.                         <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
  394.                         <Grid Grid.Row="0" Margin="0,0,0,4">
  395.                             <StackPanel Orientation="Horizontal">
  396.                                 <TextBlock Text="Images" Foreground="White" FontWeight="Bold" FontSize="13"/>
  397.                                 <TextBlock Name="LblImgCostInfo" Text="(1024 t/img)" Foreground="#FF888888" FontSize="11" Margin="8,2,0,0"/>
  398.                             </StackPanel>
  399.                             <TextBlock Name="LblImageCount" Text="0" Foreground="#FF007ACC" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right"/>
  400.                         </Grid>
  401.                         <Slider Grid.Row="1" Name="SliderImages" Minimum="0" Maximum="60" Value="0" IsSnapToTickEnabled="True" TickFrequency="1"/>
  402.                     </Grid>
  403.  
  404.                     <Grid Margin="0,0,0,12">
  405.                         <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
  406.                         <Grid Grid.Row="0" Margin="0,0,0,4">
  407.                             <StackPanel Orientation="Horizontal">
  408.                                 <TextBlock Text="RefMod Video Duration" Foreground="White" FontWeight="Bold" FontSize="13"/>
  409.                                 <TextBlock Name="LblVidCostInfo" Text="(6144 t/s)" Foreground="#FF888888" FontSize="11" Margin="8,2,15,0"/>
  410.                                 <CheckBox Name="ChkVidHasAudio" Content="Include Audio Track (+128 t/s)" Foreground="#FFBBBBBB" FontSize="11" IsChecked="False" VerticalAlignment="Center"/>
  411.                             </StackPanel>
  412.                             <TextBlock Name="LblVideoSec" Text="0s" Foreground="#FF007ACC" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right"/>
  413.                         </Grid>
  414.                         <Slider Grid.Row="1" Name="SliderVideo" Minimum="0" Maximum="240" Value="0" IsSnapToTickEnabled="True" TickFrequency="1"/>
  415.                     </Grid>
  416.  
  417.                     <Grid Margin="0,0,0,10">
  418.                         <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
  419.                         <Grid Grid.Row="0" Margin="0,0,0,4">
  420.                             <StackPanel Orientation="Horizontal">
  421.                                 <TextBlock Text="Standalone Audio Duration" Foreground="White" FontWeight="Bold" FontSize="13"/>
  422.                                 <TextBlock Name="LblAudCostInfo" Text="(128 t/s)" Foreground="#FF888888" FontSize="11" Margin="8,2,0,0"/>
  423.                             </StackPanel>
  424.                             <TextBlock Name="LblAudioSec" Text="0s" Foreground="#FF007ACC" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right"/>
  425.                         </Grid>
  426.                         <Slider Grid.Row="1" Name="SliderAudio" Minimum="0" Maximum="480" Value="0" IsSnapToTickEnabled="True" TickFrequency="1"/>
  427.                     </Grid>
  428.                 </StackPanel>
  429.  
  430.                 <!-- Reset Button -->
  431.                 <Button Grid.Row="4" Name="BtnReset" Content="RESET ALL SLIDERS" Height="34" VerticalAlignment="Bottom" Background="#FF3E3E42" Foreground="White" BorderBrush="#FF555555" FontWeight="Bold"/>
  432.             </Grid>
  433.         </Grid>
  434.     </Border>
  435. </Window>
  436. "@
  437.  
  438. # ===================== Load Window & Bind Events =====================
  439. $reader = New-Object System.Xml.XmlNodeReader($xaml)
  440. $script:Window = [Windows.Markup.XamlReader]::Load($reader)
  441.  
  442. $C = @{}
  443. @("MinimizeButton","CloseButton","DropZone","LimitLine",
  444.  "LblMeterStatus","LblMeterUnits","MeterBar","LblTokenUsage",
  445.  "TxtWidth","TxtHeight","BtnPresetDVD","BtnPreset1080",
  446.  "CmbVidMode","CmbVidRes","CmbGridSize","PnlGridSize",
  447.  "SliderImages","SliderVideo","SliderAudio","ChkVidHasAudio",
  448.  "LblImageCount","LblVideoSec","LblAudioSec",
  449.  "LblImgCostInfo","LblVidCostInfo","LblAudCostInfo",
  450.  "BtnReset"
  451. ) | ForEach-Object { $C[$_] = $script:Window.FindName($_) }
  452.  
  453. $C.MeterBar.Add_SizeChanged({ Update-LimitLinePosition })
  454. $C.CloseButton.Add_Click({ $script:Window.Close() })
  455. $C.MinimizeButton.Add_Click({ $script:Window.WindowState = 'Minimized' })
  456.  
  457. $C.SliderImages.Add_ValueChanged({ Recalculate-Budget })
  458. $C.SliderVideo.Add_ValueChanged({ Recalculate-Budget })
  459. $C.SliderAudio.Add_ValueChanged({ Recalculate-Budget })
  460.  
  461. $C.ChkVidHasAudio.Add_Checked({ Recalculate-Budget })
  462. $C.ChkVidHasAudio.Add_Unchecked({ Recalculate-Budget })
  463.  
  464. $C.TxtWidth.Add_TextChanged({ Recalculate-Budget })
  465. $C.TxtHeight.Add_TextChanged({ Recalculate-Budget })
  466.  
  467. $C.CmbVidMode.Add_SelectionChanged({ Toggle-GridVisibility })
  468. $C.CmbVidRes.Add_SelectionChanged({ Recalculate-Budget })
  469. $C.CmbGridSize.Add_SelectionChanged({ Recalculate-Budget })
  470.  
  471. $C.BtnPresetDVD.Add_Click({
  472.    $C.TxtWidth.Text  = "720"
  473.    $C.TxtHeight.Text = "480"
  474. })
  475.  
  476. $C.BtnPreset1080.Add_Click({
  477.    $C.TxtWidth.Text  = "1920"
  478.    $C.TxtHeight.Text = "1080"
  479. })
  480.  
  481. $C.DropZone.Add_PreviewDragOver({ param($s,$e)
  482.    $e.Effects = [Windows.DragDropEffects]::Copy
  483.    $e.Handled = $true
  484. })
  485.  
  486. $C.DropZone.Add_Drop({ param($s,$e)
  487.    if ($e.Data.GetDataPresent([Windows.DataFormats]::FileDrop)) {
  488.        $files = $e.Data.GetData([Windows.DataFormats]::FileDrop)
  489.        if ($files.Count -gt 0) {
  490.            $dims = Get-ImageDimensions -FilePath $files[0]
  491.            if ($dims) {
  492.                $C.TxtWidth.Text  = $dims.Width
  493.                $C.TxtHeight.Text = $dims.Height
  494.            }
  495.        }
  496.    }
  497. })
  498.  
  499. $C.BtnReset.Add_Click({
  500.    $C.SliderImages.Value = 0
  501.    $C.SliderVideo.Value  = 0
  502.    $C.SliderAudio.Value  = 0
  503. })
  504.  
  505. Recalculate-Budget
  506. $script:Window.ShowDialog() | Out-Null
Tags: ComfyUI RefMod
Advertisement
Comments
  • User was banned
  • Nikrinte
    5 days
    # CSS 0.92 KB | 0 0
    1. ✅ Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1WhlQi8xpq819kqTE2nXcZTAeCgQ5m-ic2pm_7IZVt7w/edit?usp=sharing
    4.  
    5. This made me $12,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
    8.  
    9. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    10.  
    11. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).
    12.  
    13. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment