fix(plugin): make sure number input nodes takes down to 0.01 steps and its casted to float
This commit is contained in:
		
							parent
							
								
									19511e55ba
								
							
						
					
					
						commit
						9e79c434a9
					
				@ -29,9 +29,12 @@ class ComfyUIDeployExternalNumber:
 | 
				
			|||||||
    CATEGORY = "number"
 | 
					    CATEGORY = "number"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self, input_id, default_value=None):
 | 
					    def run(self, input_id, default_value=None):
 | 
				
			||||||
        if not input_id or not input_id.strip().isdigit():
 | 
					        try:
 | 
				
			||||||
 | 
					            float_value = float(input_id)
 | 
				
			||||||
 | 
					            print("my number", float_value)
 | 
				
			||||||
 | 
					            return [float_value]
 | 
				
			||||||
 | 
					        except ValueError:
 | 
				
			||||||
            return [default_value]
 | 
					            return [default_value]
 | 
				
			||||||
        return [int(input_id)]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalNumber": ComfyUIDeployExternalNumber}
 | 
					NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalNumber": ComfyUIDeployExternalNumber}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user