Run this model with HF Jobs
Run hpkim0512/peanuts_avatar on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/hpkim0512/peanuts_avatar. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/hpkim0512/peanuts_avatar on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use hpkim0512/peanuts_avatar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hpkim0512/peanuts_avatar with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import AutoPipelineForInpainting from diffusers.utils import load_image # switch to "mps" for apple devices pipe = AutoPipelineForInpainting.from_pretrained("hpkim0512/peanuts_avatar", dtype=torch.float16, device_map="cuda") img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" image = load_image(img_url).resize((1024, 1024)) mask_image = load_image(mask_url).resize((1024, 1024)) prompt = "a tiger sitting on a park bench" generator = torch.Generator(device="cuda").manual_seed(0) image = pipe( prompt=prompt, image=image, mask_image=mask_image, guidance_scale=8.0, num_inference_steps=20, # steps between 15 and 30 work well for us strength=0.99, # make sure to use `strength` below 1.0 generator=generator, ).images[0] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (22)
- image_encoder/config.jsonAdded+23
- image_encoder/model.safetensorsAdded+3
- model_index.jsonAdded+47
- scheduler/scheduler_config.jsonAdded+23
- text_encoder/config.jsonAdded+25
- text_encoder/model.safetensorsAdded+3
- text_encoder_2/config.jsonAdded+25
- text_encoder_2/model.safetensorsAdded+3
- tokenizer/merges.txtAdded
- tokenizer/special_tokens_map.jsonAdded+24
- tokenizer/tokenizer_config.jsonAdded+30
- tokenizer/vocab.jsonAdded
- tokenizer_2/merges.txtAdded
- tokenizer_2/special_tokens_map.jsonAdded+24
- tokenizer_2/tokenizer_config.jsonAdded+38
- tokenizer_2/vocab.jsonAdded
- unet/config.jsonAdded+80
- unet/diffusion_pytorch_model.safetensorsAdded+3
- unet_encoder/config.jsonAdded+73
- unet_encoder/diffusion_pytorch_model.safetensorsAdded+3
- vae/config.jsonAdded+32
- vae/diffusion_pytorch_model.safetensorsAdded+3
1234567891011121314151617181920212223{ "_name_or_path": "/workspace/peanuts_avatar/peanuts_avatar/inpaint/idm_vton/ckpt/image_encoder", "architectures": [ "CLIPVisionModelWithProjection" ], "attention_dropout": 0.0, "dropout": 0.0, "hidden_act": "gelu", "hidden_size": 1280, "image_size": 224, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "model_type": "clip_vision_model", "num_attention_heads": 16, "num_channels": 3, "num_hidden_layers": 32, "patch_size": 14, "projection_dim": 1024, "torch_dtype": "bfloat16", "transformers_version": "4.36.2"}123version https://git-lfs.github.com/spec/v1oid sha256:f5c0bbf4f43f319a80335387d371742333807589c5bb4130a1a2a5d4abf6bf72size 12642177601234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "_class_name": "StableDiffusionXLInpaintPipeline", "_diffusers_version": "0.25.0", "_name_or_path": "diffusers/stable-diffusion-xl-1.0-inpainting-0.1", "feature_extractor": [ null, null ], "force_zeros_for_empty_prompt": true, "image_encoder": [ "transformers", "CLIPVisionModelWithProjection" ], "requires_aesthetics_score": false, "scheduler": [ "diffusers", "DDPMScheduler" ], "text_encoder": [ "transformers", "CLIPTextModel" ], "text_encoder_2": [ "transformers", "CLIPTextModelWithProjection" ], "tokenizer": [ "transformers", "CLIPTokenizer" ], "tokenizer_2": [ "transformers", "CLIPTokenizer" ], "unet": [ "peanuts_avatar.inpaint.idm_vton.src.unet_hacked_tryon", "UNet2DConditionModel" ], "unet_encoder": [ "peanuts_avatar.inpaint.idm_vton.src.unet_hacked_garmnet", "UNet2DConditionModel" ], "vae": [ "diffusers", "AutoencoderKL" ]}1234567891011121314151617181920212223{ "_class_name": "DDPMScheduler", "_diffusers_version": "0.25.0", "beta_end": 0.012, "beta_schedule": "scaled_linear", "beta_start": 0.00085, "clip_sample": false, "clip_sample_range": 1.0, "dynamic_thresholding_ratio": 0.995, "interpolation_type": "linear", "num_train_timesteps": 1000, "prediction_type": "epsilon", "rescale_betas_zero_snr": true, "sample_max_value": 1.0, "set_alpha_to_one": false, "skip_prk_steps": true, "steps_offset": 1, "thresholding": false, "timestep_spacing": "leading", "trained_betas": null, "use_karras_sigmas": false, "variance_type": "fixed_small"}12345678910111213141516171819202122232425{ "_name_or_path": "diffusers/stable-diffusion-xl-1.0-inpainting-0.1", "architectures": [ "CLIPTextModel" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "quick_gelu", "hidden_size": 768, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_text_model", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 1, "projection_dim": 768, "torch_dtype": "bfloat16", "transformers_version": "4.36.2", "vocab_size": 49408}123version https://git-lfs.github.com/spec/v1oid sha256:03532a1b8bb2f02b16b9b290273caf9c8793a0a268517c104eee30f7d1829120size 24614435212345678910111213141516171819202122232425{ "_name_or_path": "diffusers/stable-diffusion-xl-1.0-inpainting-0.1", "architectures": [ "CLIPTextModelWithProjection" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "gelu", "hidden_size": 1280, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_text_model", "num_attention_heads": 20, "num_hidden_layers": 32, "pad_token_id": 1, "projection_dim": 1280, "torch_dtype": "bfloat16", "transformers_version": "4.36.2", "vocab_size": 49408}123version https://git-lfs.github.com/spec/v1oid sha256:c4ba596d8c78b5509aafd523f619e13aa129ae1a886a1e92766d7cddd9706f3csize 1389382688123456789101112131415161718192021222324{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "<|endoftext|>", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930{ "add_prefix_space": false, "added_tokens_decoder": { "49406": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "49407": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<|startoftext|>", "clean_up_tokenization_spaces": true, "do_lower_case": true, "eos_token": "<|endoftext|>", "errors": "replace", "model_max_length": 77, "pad_token": "<|endoftext|>", "tokenizer_class": "CLIPTokenizer", "unk_token": "<|endoftext|>"}123456789101112131415161718192021222324{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "!", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}1234567891011121314151617181920212223242526272829303132333435363738{ "add_prefix_space": false, "added_tokens_decoder": { "0": { "content": "!", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "49406": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "49407": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<|startoftext|>", "clean_up_tokenization_spaces": true, "do_lower_case": true, "eos_token": "<|endoftext|>", "errors": "replace", "model_max_length": 77, "pad_token": "!", "tokenizer_class": "CLIPTokenizer", "unk_token": "<|endoftext|>"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980{ "_class_name": "UNet2DConditionModel", "_diffusers_version": "0.25.0", "_name_or_path": "yisol/IDM-VTON", "act_fn": "silu", "addition_embed_type": "text_time", "addition_embed_type_num_heads": 64, "addition_time_embed_dim": 256, "attention_head_dim": [ 5, 10, 20 ], "attention_type": "default", "block_out_channels": [ 320, 640, 1280 ], "center_input_sample": false, "class_embed_type": null, "class_embeddings_concat": false, "conv_in_kernel": 3, "conv_out_kernel": 3, "cross_attention_dim": 2048, "cross_attention_norm": null, "decay": 0.9999, "down_block_types": [ "DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D" ], "downsample_padding": 1, "dropout": 0.0, "dual_cross_attention": false, "encoder_hid_dim": 1280, "encoder_hid_dim_type": "ip_image_proj", "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 13, "inv_gamma": 1.0, "layers_per_block": 2, "mid_block_only_cross_attention": null, "mid_block_scale_factor": 1, "mid_block_type": "UNetMidBlock2DCrossAttn", "min_decay": 0.0, "norm_eps": 1e-05, "norm_num_groups": 32, "num_attention_heads": null, "num_class_embeds": null, "only_cross_attention": false, "optimization_step": 37000, "out_channels": 4, "power": 0.6666666666666666, "projection_class_embeddings_input_dim": 2816, "resnet_out_scale_factor": 1.0, "resnet_skip_time_act": false, "resnet_time_scale_shift": "default", "reverse_transformer_layers_per_block": null, "sample_size": 128, "time_cond_proj_dim": null, "time_embedding_act_fn": null, "time_embedding_dim": null, "time_embedding_type": "positional", "timestep_post_act": null, "transformer_layers_per_block": [ 1, 2, 10 ], "up_block_types": [ "CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D" ], "upcast_attention": null, "update_after_step": 0, "use_ema_warmup": false, "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:5df8dd1704d507aea286ff9a4d4ba1369bb75e00bc22a287e61a5b7002597f7fsize 1060203403212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273{ "_class_name": "UNet2DConditionModel", "_diffusers_version": "0.25.0", "_name_or_path": "yisol/IDM-VTON", "act_fn": "silu", "addition_embed_type": null, "addition_embed_type_num_heads": 64, "addition_time_embed_dim": 256, "attention_head_dim": [ 5, 10, 20 ], "attention_type": "default", "block_out_channels": [ 320, 640, 1280 ], "center_input_sample": false, "class_embed_type": null, "class_embeddings_concat": false, "conv_in_kernel": 3, "conv_out_kernel": 3, "cross_attention_dim": 2048, "cross_attention_norm": null, "down_block_types": [ "DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D" ], "downsample_padding": 1, "dropout": 0.0, "dual_cross_attention": false, "encoder_hid_dim": null, "encoder_hid_dim_type": null, "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 4, "layers_per_block": 2, "mid_block_only_cross_attention": null, "mid_block_scale_factor": 1, "mid_block_type": "UNetMidBlock2DCrossAttn", "norm_eps": 1e-05, "norm_num_groups": 32, "num_attention_heads": null, "num_class_embeds": null, "only_cross_attention": false, "out_channels": 4, "projection_class_embeddings_input_dim": 2816, "resnet_out_scale_factor": 1.0, "resnet_skip_time_act": false, "resnet_time_scale_shift": "default", "reverse_transformer_layers_per_block": null, "sample_size": 128, "time_cond_proj_dim": null, "time_embedding_act_fn": null, "time_embedding_dim": null, "time_embedding_type": "positional", "timestep_post_act": null, "transformer_layers_per_block": [ 1, 2, 10 ], "up_block_types": [ "CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D" ], "upcast_attention": null, "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:efa04c3adf3152727ce53be8706e9e4ada6175882328ecbd34b86f485f83e382size 51246600721234567891011121314151617181920212223242526272829303132{ "_class_name": "AutoencoderKL", "_diffusers_version": "0.25.0", "_name_or_path": "diffusers/stable-diffusion-xl-1.0-inpainting-0.1", "act_fn": "silu", "block_out_channels": [ 128, 256, 512, 512 ], "down_block_types": [ "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D" ], "force_upcast": false, "in_channels": 3, "latent_channels": 4, "layers_per_block": 2, "norm_num_groups": 32, "out_channels": 3, "sample_size": 512, "scaling_factor": 0.13025, "up_block_types": [ "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D" ]}123version https://git-lfs.github.com/spec/v1oid sha256:6353737672c94b96174cb590f711eac6edf2fcce5b6e91aa9d73c5adc589ee48size 167335342image_encoder/config.jsonAdded+23
image_encoder/model.safetensorsAdded+3
model_index.jsonAdded+47
scheduler/scheduler_config.jsonAdded+23
text_encoder/config.jsonAdded+25
text_encoder/model.safetensorsAdded+3
text_encoder_2/config.jsonAdded+25
text_encoder_2/model.safetensorsAdded+3
tokenizer/merges.txtAdded
tokenizer/special_tokens_map.jsonAdded+24
tokenizer/tokenizer_config.jsonAdded+30
tokenizer/vocab.jsonAdded
tokenizer_2/merges.txtAdded
tokenizer_2/special_tokens_map.jsonAdded+24
tokenizer_2/tokenizer_config.jsonAdded+38
tokenizer_2/vocab.jsonAdded
unet/config.jsonAdded+80
unet/diffusion_pytorch_model.safetensorsAdded+3
unet_encoder/config.jsonAdded+73
unet_encoder/diffusion_pytorch_model.safetensorsAdded+3
vae/config.jsonAdded+32
vae/diffusion_pytorch_model.safetensorsAdded+3