MCPcopy Index your code

hub / github.com/apple/ml-stable-diffusion / functions

Functions150 in github.com/apple/ml-stable-diffusion

↓ 16 callersMethod__init__
(self, dim_in, dim_out)
python_coreml_stable_diffusion/unet.py:604
↓ 8 callersFunction_get_out_path
(args, submodule_name)
python_coreml_stable_diffusion/torch2coreml.py:94
↓ 8 callersFunctionreport_correctness
Report PSNR values across two compatible tensors
python_coreml_stable_diffusion/torch2coreml.py:75
↓ 6 callersFunction_convert_to_coreml
(submodule_name, torchscript_module, sample_inputs, output_names, args, out_path=None,
python_coreml_stable_diffusion/torch2coreml.py:100
↓ 5 callersFunctionrun_pipe
(pipe)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:248
↓ 4 callersFunctioncompute_psnr
Compute Peak-Signal-to-Noise-Ratio across two numpy.ndarray objects
python_coreml_stable_diffusion/torch2coreml.py:54
↓ 4 callersFunctioncosine_distance
(image_embeds, text_embeds)
python_coreml_stable_diffusion/torch2coreml.py:974
↓ 4 callersFunctionget_pipeline
(args)
python_coreml_stable_diffusion/torch2coreml.py:1278
↓ 3 callersFunction_compile_coreml_model
Compiles Core ML models using the coremlcompiler utility from Xcode toolchain
python_coreml_stable_diffusion/torch2coreml.py:190
↓ 3 callersFunctioncompress_kmeans
(val, nbits)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:144
↓ 3 callersFunctionfake_palettize
Simulate weight palettization
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:139
↓ 3 callersFunctionsimulate_quant_fn
(ref_pipe, quantization_to_simulate)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:336
↓ 2 callersMethod__init__
(self)
python_coreml_stable_diffusion/torch2coreml.py:504
↓ 2 callersFunction_ensure_numerical_range_and_cast
For some cases, the computed quantized data might exceed the data range. For instance, after rounding and addition, we might get `128
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:70
↓ 2 callersFunction_get_first_chunk_outputs
(block, op_idx)
python_coreml_stable_diffusion/chunk_mlprogram.py:130
↓ 2 callersMethod_init_coreml_pipe
Initializes CoreML pipe for the requested compute_unit
tests/test_stable_diffusion.py:218
↓ 2 callersFunction_load_mlpackage
Load Core ML (mlpackage) models from disk (As exported by torch2coreml.py)
python_coreml_stable_diffusion/coreml_model.py:133
↓ 2 callersFunction_load_prog_from_mlmodel
Load MIL Program from an MLModel
python_coreml_stable_diffusion/chunk_mlprogram.py:82
↓ 2 callersFunction_quantize_weights
(out_path, model_name, nbits)
python_coreml_stable_diffusion/torch2coreml.py:165
↓ 2 callersFunction_verify_output_correctness_of_chunks
Verifies the end-to-end output correctness of full (original) model versus chunked models
python_coreml_stable_diffusion/chunk_mlprogram.py:34
↓ 2 callersFunctionbenchmark_signal_integrity
(pipe, candidates, nbits,
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:280
↓ 2 callersFunctioncalculate_conv2d_output_shape
(in_h, in_w, conv2d_layer)
python_coreml_stable_diffusion/unet.py:1237
↓ 2 callersFunctionconvert_text_encoder
Converts the text encoder component of Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:295
↓ 2 callersFunctionconvert_unet
Converts the UNet component of Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:660
↓ 2 callersFunctionget_activation
(act_fn)
python_coreml_stable_diffusion/unet.py:613
↓ 2 callersFunctionget_available_compute_units
()
python_coreml_stable_diffusion/coreml_model.py:194
↓ 2 callersFunctionget_down_block
( down_block_type, num_layers, in_channels, out_channels, temb_channels, resnet_eps,
python_coreml_stable_diffusion/unet.py:1145
↓ 2 callersFunctionget_tensor_hash
(tensor)
python_coreml_stable_diffusion/mixed_bit_compression_apply.py:45
↓ 2 callersFunctionmodify_coremltools_torch_frontend_badbmm
Modifies coremltools torch frontend for baddbmm to be robust to the `beta` argument being of non-float dtype: e.g. https://github.com/hugging
python_coreml_stable_diffusion/torch2coreml.py:416
↓ 1 callersMethod__init__
( self, in_channels=4, flip_sin_to_cos=True, freq_shift=0, down_block_
python_coreml_stable_diffusion/controlnet.py:52
↓ 1 callersFunction_add_fp32_casts
(block, boundary_vars)
python_coreml_stable_diffusion/chunk_mlprogram.py:148
↓ 1 callersMethod_coreml_text_to_image_with_compute_unit
Benchmark end-to-end text-to-image generation with the requested compute_unit
tests/test_stable_diffusion.py:239
↓ 1 callersMethod_encode_prompt
(self, prompt, prompt_2: Optional[str] = None,
python_coreml_stable_diffusion/pipeline.py:123
↓ 1 callersFunction_extend_parser
(parser)
tests/test_stable_diffusion.py:306
↓ 1 callersMethod_get_add_time_ids
(self, original_size, crops_coords_top_left, target_size, dtype)
python_coreml_stable_diffusion/pipeline.py:398
↓ 1 callersFunction_get_controlnet_base_model
(controlnet_model_version)
python_coreml_stable_diffusion/torch2coreml.py:1105
↓ 1 callersFunction_get_coreml_inputs
(sample_inputs, args)
python_coreml_stable_diffusion/torch2coreml.py:44
↓ 1 callersFunction_get_op_idx_split_location
Find the op that approximately bisects the graph as measure by weights size on each side
python_coreml_stable_diffusion/chunk_mlprogram.py:100
↓ 1 callersFunction_get_test_artifacts_dir
(args)
tests/test_stable_diffusion.py:296
↓ 1 callersFunction_load_mlpackage_controlnet
Load Core ML (mlpackage) models from disk (As exported by torch2coreml.py)
python_coreml_stable_diffusion/coreml_model.py:176
↓ 1 callersFunction_make_first_chunk_prog
Build first chunk by declaring early outputs and removing unused subgraph
python_coreml_stable_diffusion/chunk_mlprogram.py:159
↓ 1 callersFunction_make_second_chunk_prog
Build second chunk by rebuilding a pristine MIL Program from MLModel
python_coreml_stable_diffusion/chunk_mlprogram.py:174
↓ 1 callersMethod_reset_parameters
(self)
python_coreml_stable_diffusion/layer_norm.py:46
↓ 1 callersFunction_reset_seed
Reset RNG state in order to reproduce the results across multiple runs
tests/test_stable_diffusion.py:289
↓ 1 callersMethod_verify_inputs
(self, **kwargs)
python_coreml_stable_diffusion/coreml_model.py:75
↓ 1 callersFunctionbuild_recipe
(results, sizes, psnr_threshold, default_nbits)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:352
↓ 1 callersFunctionbundle_resources_for_swift_cli
- Compiles Core ML models from mlpackage into mlmodelc format - Download tokenizer resources for the text encoder
python_coreml_stable_diffusion/torch2coreml.py:210
↓ 1 callersMethodcheck_inputs
(self, prompt, height, width, callback_steps)
python_coreml_stable_diffusion/pipeline.py:359
↓ 1 callersFunctioncompute_x_axis
(sizes, nbits, default_nbits)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:381
↓ 1 callersFunctionconvert_controlnet
Converts each ControlNet for Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:1110
↓ 1 callersFunctionconvert_safety_checker
Converts the Safety Checker component of Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:912
↓ 1 callersFunctionconvert_vae_decoder
Converts the VAE Decoder component of Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:464
↓ 1 callersFunctionconvert_vae_encoder
Converts the VAE Encoder component of Stable Diffusion
python_coreml_stable_diffusion/torch2coreml.py:561
↓ 1 callersMethoddecode_latents
(self, latents)
python_coreml_stable_diffusion/pipeline.py:313
↓ 1 callersFunctiondescending_psnr_order
(results)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:329
↓ 1 callersFunctionfake_linear_quantize
(val, axis=-1, mode='LINEAR', dtype=types.int8)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:65
↓ 1 callersFunctionfake_nbits_palette
(module, nbits)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:216
↓ 1 callersFunctionget_available_schedulers
()
python_coreml_stable_diffusion/pipeline.py:564
↓ 1 callersFunctionget_coreml_pipe
Initializes and returns a `CoreMLStableDiffusionPipeline` from an original diffusers PyTorch pipeline sources: 'packages' or 'compile
python_coreml_stable_diffusion/pipeline.py:579
↓ 1 callersFunctionget_image_path
mkdir output folder and encode metadata in the filename
python_coreml_stable_diffusion/pipeline.py:671
↓ 1 callersMethodget_num_residuals
(self)
python_coreml_stable_diffusion/controlnet.py:191
↓ 1 callersFunctionget_palettizable_modules
(unet, min_size=PALETTIZE_MIN_SIZE)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:194
↓ 1 callersFunctionget_resource_type
Detect resource type based on filepath extensions. returns: `packages`: for .mlpackage resources 'compiled`:
python_coreml_stable_diffusion/coreml_model.py:104
↓ 1 callersFunctionget_timestep_embedding
( timesteps, embedding_dim, flip_sin_to_cos=False, downscale_freq_shift=1, scale=1, ma
python_coreml_stable_diffusion/unet.py:696
↓ 1 callersFunctionget_up_block
( up_block_type, num_layers, in_channels, out_channels, prev_output_channel, temb_chan
python_coreml_stable_diffusion/unet.py:1191
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/torch2coreml.py:1303
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/pipeline.py:695
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/chunk_mlprogram.py:231
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/mixed_bit_compression_apply.py:23
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/multilingual_projection.py:15
↓ 1 callersFunctionmain
(args)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:436
↓ 1 callersFunctionparser_spec
()
python_coreml_stable_diffusion/torch2coreml.py:1378
↓ 1 callersFunctionplot
(results, args)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:376
↓ 1 callersMethodprepare_control_cond
(self, controlnet_cond, do_classifier_free_guidance,
python_coreml_stable_diffusion/pipeline.py:346
↓ 1 callersFunctionprepare_controlnet_cond
(image_path, height, width)
python_coreml_stable_diffusion/pipeline.py:688
↓ 1 callersMethodprepare_extra_step_kwargs
(self, eta)
python_coreml_stable_diffusion/pipeline.py:384
↓ 1 callersMethodprepare_latents
(self, batch_size, num_channels_latents,
python_coreml_stable_diffusion/pipeline.py:322
↓ 1 callersFunctionquantize_weights
Quantize weights to args.quantize_nbits using a palette (look-up table)
python_coreml_stable_diffusion/torch2coreml.py:141
↓ 1 callersFunctionrestore_weight
(module, value)
python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py:189
↓ 1 callersMethodrun_controlnet
(self, sample, timestep, encoder_hidden_s
python_coreml_stable_diffusion/pipeline.py:259
↓ 1 callersMethodrun_safety_checker
(self, image)
python_coreml_stable_diffusion/pipeline.py:286
↓ 1 callersFunctionsplit_einsum
Attention Implementation backing AttentionImplementations.SPLIT_EINSUM - Implements https://machinelearning.apple.com/research/neural-engine-tra
python_coreml_stable_diffusion/attention.py:8
Method__call__
( self, prompt, height=512, width=512, num_inferen
python_coreml_stable_diffusion/pipeline.py:403
Method__call__
(self, **kwargs)
python_coreml_stable_diffusion/coreml_model.py:96
Method__init__
(self, query_dim, context_dim=None, heads=8, dim_head=64)
python_coreml_stable_diffusion/unet.py:49
Method__init__
(self, *args, **kwargs)
python_coreml_stable_diffusion/unet.py:136
Method__init__
( self, in_channels, out_channels, prev_output_channel, temb_channels,
python_coreml_stable_diffusion/unet.py:146
Method__init__
( self, in_channels, prev_output_channel, out_channels, temb_channels,
python_coreml_stable_diffusion/unet.py:223
Method__init__
( self, in_channels, out_channels, temb_channels, transformer_layers_p
python_coreml_stable_diffusion/unet.py:277
Method__init__
( self, in_channels, out_channels, temb_channels, num_layers=1,
python_coreml_stable_diffusion/unet.py:348
Method__init__
( self, *, in_channels, out_channels=None, conv_shortcut=False,
python_coreml_stable_diffusion/unet.py:401
Method__init__
(self, channels)
python_coreml_stable_diffusion/unet.py:487
Method__init__
(self, channels)
python_coreml_stable_diffusion/unet.py:498
Method__init__
( self, in_channels, n_heads, d_head, depth=1, context_dim=Non
python_coreml_stable_diffusion/unet.py:508
Method__init__
(self, dim, n_heads, d_head, context_dim=None, gated_ff=True)
python_coreml_stable_diffusion/unet.py:561
Method__init__
(self, dim, dim_out=None, mult=4, glu=False)
python_coreml_stable_diffusion/unet.py:589
Method__init__
( self, in_channels, time_embed_dim, act_fn = "silu", out_dim = None,
python_coreml_stable_diffusion/unet.py:624
Method__init__
(self, num_channels, flip_sin_to_cos, downscale_freq_shift)
python_coreml_stable_diffusion/unet.py:680
Method__init__
( self, in_channels, temb_channels, num_layers=1, resnet_eps=1e-6,
python_coreml_stable_diffusion/unet.py:726
Method__init__
( self, sample_size=None, in_channels=4, out_channels=4, center_input_
python_coreml_stable_diffusion/unet.py:794
next →1–100 of 150, ranked by callers