File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -549,6 +549,8 @@ def check_inputs(
549549        prompt ,
550550        prompt_2 ,
551551        prompt_3 ,
552+         height ,
553+         width ,
552554        strength ,
553555        negative_prompt = None ,
554556        negative_prompt_2 = None ,
@@ -560,6 +562,15 @@ def check_inputs(
560562        callback_on_step_end_tensor_inputs = None ,
561563        max_sequence_length = None ,
562564    ):
565+         if  (
566+             height  %  (self .vae_scale_factor  *  self .patch_size ) !=  0 
567+             or  width  %  (self .vae_scale_factor  *  self .patch_size ) !=  0 
568+         ):
569+             raise  ValueError (
570+                 f"`height` and `width` have to be divisible by { self .vae_scale_factor  *  self .patch_size } { height } { width }  
571+                 f"You can use height { height  -  height  %  (self .vae_scale_factor  *  self .patch_size )} { width  -  width  %  (self .vae_scale_factor  *  self .patch_size )}  
572+             )
573+ 
563574        if  strength  <  0  or  strength  >  1 :
564575            raise  ValueError (f"The value of strength should in [0.0, 1.0] but is { strength }  )
565576
Original file line number Diff line number Diff line change @@ -538,6 +538,8 @@ def check_inputs(
538538        prompt ,
539539        prompt_2 ,
540540        prompt_3 ,
541+         height ,
542+         width ,
541543        strength ,
542544        negative_prompt = None ,
543545        negative_prompt_2 = None ,
@@ -549,6 +551,15 @@ def check_inputs(
549551        callback_on_step_end_tensor_inputs = None ,
550552        max_sequence_length = None ,
551553    ):
554+         if  (
555+             height  %  (self .vae_scale_factor  *  self .patch_size ) !=  0 
556+             or  width  %  (self .vae_scale_factor  *  self .patch_size ) !=  0 
557+         ):
558+             raise  ValueError (
559+                 f"`height` and `width` have to be divisible by { self .vae_scale_factor  *  self .patch_size } { height } { width }  
560+                 f"You can use height { height  -  height  %  (self .vae_scale_factor  *  self .patch_size )} { width  -  width  %  (self .vae_scale_factor  *  self .patch_size )}  
561+             )
562+ 
552563        if  strength  <  0  or  strength  >  1 :
553564            raise  ValueError (f"The value of strength should in [0.0, 1.0] but is { strength }  )
554565
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments