This is the ComfyUI repo. What's the receptive field radius of SDXL VAE?
- User
This is the ComfyUI repo. What's the receptive field radius of SDXL VAE?
Assistant
Based on the code analysis of the ComfyUI repository, specifically
comfy/sd.pyandcomfy/ldm/modules/diffusionmodules/model.py, here is the information regarding the SDXL VAE receptive field.The SDXL VAE (like the standard SD 1.x/2.x VAE) uses a configuration with
ch_mult=[1, 2, 4, 4]and 2 ResNet blocks per level. This results in the following architecture:- Structure: 4 levels with 3 downsampling operations (total downsample factor of 8).
- Total Receptive Field Size: 217 pixels.
- Receptive Field Radius: .
- User
What's the receptive field radius of Flux 1 VAE?
Assistant
Based on the analysis of
comfy/sd.pyandcomfy/supported_models.py, the Flux 1 VAE uses the same architectural configuration as the standard SDXL/SD1.x VAE, but with 16 latent channels instead of 4.ComfyUI initializes the Flux VAE using the default
AutoencoderKLconfiguration (found incomfy/sd.py) because it detects the standard keys but adapts the channel count dynamically:ddconfig = { 'double_z': True, 'z_channels': 4, # Overwritten to 16 for Flux based on weight shape 'resolution': 256, 'in_channels': 3, 'out_ch': 3, 'ch': 128, 'ch_mult': [1, 2, 4, 4], 'num_res_blocks': 2, # ... }With
ch_mult=[1, 2, 4, 4](implying 3 downsampling steps for a factor of 8) andnum_res_blocks=2, the receptive field calculation remains the same as for SDXL:- Total Receptive Field: 217 pixels
- Receptive Field Radius: 108 pixels
This means the encoder requires a radius of 108 pixels (context) around the center of the patch to accurately encode a single latent pixel without padding artifacts.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.