zsxkib/ic-light-background πŸ”’β“πŸ“πŸ–ΌοΈβœ“ β†’ πŸ–ΌοΈ

▢️ 47.5K runs πŸ“… May 2024 βš™οΈ Cog 0.9.7 πŸ”— GitHub βš–οΈ License
image-editing image-re-lighting

About

πŸ–ΌοΈβœ¨Background images + prompts to auto-magically relights your images (+normal mapsπŸ—ΊοΈ)

Example Output

Prompt:

"Woman, detailed face, sci-fi RGB glowing, cyberpunk"

Output

Example output

Performance Metrics

8.91s Prediction Time
250.31s Total Time
All Input Parameters
{
  "cfg": 2,
  "steps": 25,
  "width": 512,
  "height": 832,
  "prompt": "Woman, detailed face, sci-fi RGB glowing, cyberpunk",
  "light_source": "Use Background Image",
  "highres_scale": 1.5,
  "output_format": "webp",
  "subject_image": "https://replicate.delivery/pbxt/KtCKrs9sxPF3HciwoWL0TTVM9Nde7ySDWpO9S2flTiyi9Pp3/i3.png",
  "compute_normal": false,
  "output_quality": 80,
  "appended_prompt": "best quality",
  "highres_denoise": 0.5,
  "negative_prompt": "lowres, bad anatomy, bad hands, cropped, worst quality",
  "background_image": "https://replicate.delivery/pbxt/KxPIbJUjSmVBlvn0M3C8PAz6brN5Z0eyZSGcKIVw3XfJ6vNV/7.webp",
  "number_of_images": 1
}
Input Parameters
cfg Type: numberDefault: 2Range: 1 - 32
Classifier-Free Guidance scale - higher values encourage adherence to prompt, lower values encourage more creative interpretation
seed Type: integer
A fixed random seed for reproducible results (omit this parameter for a randomized seed)
steps Type: integerDefault: 25Range: 1 - 100
The number of diffusion steps to perform during generation (more steps generally improves image quality but increases processing time)
width Default: 512
The width of the generated images in pixels
height Default: 640
The height of the generated images in pixels
prompt (required) Type: string
A text description guiding the relighting and generation process
light_source Default: Use Background Image
The type and position of lighting to apply to the initial background latent
highres_scale Type: numberDefault: 1.5Range: 1 - 3
The multiplier for the final output resolution relative to the initial latent resolution
output_format Default: webp
The image file format of the generated output images
subject_image (required) Type: string
The main foreground image to be relighted
compute_normal Type: booleanDefault: false
Whether to compute the normal maps (slower but provides additional output images)
output_quality Type: integerDefault: 80Range: 0 - 100
The image compression quality (for lossy formats like JPEG and WebP). 100 = best quality, 0 = lowest quality.
appended_prompt Type: stringDefault: best quality
Additional text to be appended to the main prompt, enhancing image quality
highres_denoise Type: numberDefault: 0.5Range: 0.1 - 1
Controls the amount of denoising applied when refining the high resolution output (higher = more adherence to the upscaled latent, lower = more creative details added)
negative_prompt Type: stringDefault: lowres, bad anatomy, bad hands, cropped, worst quality
A text description of attributes to avoid in the generated images
background_image (required) Type: string
The background image that will be used to relight the main foreground image
number_of_images Type: integerDefault: 1Range: 1 - 12
The number of unique images to generate from the given input and settings
Output Schema

Output

Type: array β€’ Items Type: string β€’ Items Format: uri

Example Execution Logs
Using seed: 62600
[!] (<class 'cog.types.Path'>) input_fg=/tmp/tmpcq1zmhq8i3.png
[!] (<class 'cog.types.Path'>) input_bg=/tmp/tmphw3rq_ql7.webp
[!] (<class 'str'>) prompt=Woman, detailed face, sci-fi RGB glowing, cyberpunk
[!] (<class 'int'>) image_width=512
[!] (<class 'int'>) image_height=832
[!] (<class 'int'>) num_samples=1
[!] (<class 'int'>) seed=62600
[!] (<class 'int'>) steps=25
[!] (<class 'str'>) a_prompt=best quality
[!] (<class 'str'>) n_prompt=lowres, bad anatomy, bad hands, cropped, worst quality
[!] (<class 'float'>) cfg=2.0
[!] (<class 'float'>) highres_scale=1.5
[!] (<class 'float'>) highres_denoise=0.5
[!] (<class 'str'>) bg_source=Use Background Image
/root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/nn/modules/conv.py:456: UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnFinalize Descriptor Failed cudnn_status: CUDNN_STATUS_NOT_SUPPORTED (Triggered internally at ../aten/src/ATen/native/cudnn/Conv_v8.cpp:919.)
return F.conv2d(input, weight, bias, self.stride,
  0%|          | 0/25 [00:00<?, ?it/s]
  4%|▍         | 1/25 [00:00<00:03,  6.67it/s]
 16%|β–ˆβ–Œ        | 4/25 [00:00<00:01, 16.07it/s]
 24%|β–ˆβ–ˆβ–       | 6/25 [00:00<00:01, 16.74it/s]
 32%|β–ˆβ–ˆβ–ˆβ–      | 8/25 [00:00<00:00, 17.09it/s]
 40%|β–ˆβ–ˆβ–ˆβ–ˆ      | 10/25 [00:00<00:00, 17.29it/s]
 48%|β–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 12/25 [00:00<00:00, 17.40it/s]
 56%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    | 14/25 [00:00<00:00, 17.46it/s]
 64%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 16/25 [00:00<00:00, 17.52it/s]
 72%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 18/25 [00:01<00:00, 17.56it/s]
 80%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 20/25 [00:01<00:00, 17.55it/s]
 88%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 22/25 [00:01<00:00, 17.54it/s]
 96%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 24/25 [00:01<00:00, 17.57it/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 25/25 [00:01<00:00, 17.04it/s]
  0%|          | 0/25 [00:00<?, ?it/s]
  4%|▍         | 1/25 [00:00<00:04,  5.71it/s]
 12%|β–ˆβ–        | 3/25 [00:00<00:02,  9.01it/s]
 16%|β–ˆβ–Œ        | 4/25 [00:00<00:02,  8.16it/s]
 20%|β–ˆβ–ˆ        | 5/25 [00:00<00:02,  7.71it/s]
 24%|β–ˆβ–ˆβ–       | 6/25 [00:00<00:02,  7.44it/s]
 28%|β–ˆβ–ˆβ–Š       | 7/25 [00:00<00:02,  7.26it/s]
 32%|β–ˆβ–ˆβ–ˆβ–      | 8/25 [00:01<00:02,  7.16it/s]
 36%|β–ˆβ–ˆβ–ˆβ–Œ      | 9/25 [00:01<00:02,  7.08it/s]
 40%|β–ˆβ–ˆβ–ˆβ–ˆ      | 10/25 [00:01<00:02,  7.03it/s]
 44%|β–ˆβ–ˆβ–ˆβ–ˆβ–     | 11/25 [00:01<00:02,  7.00it/s]
 48%|β–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 12/25 [00:01<00:01,  6.98it/s]
 52%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    | 13/25 [00:01<00:01,  6.96it/s]
 56%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    | 14/25 [00:01<00:01,  6.95it/s]
 60%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    | 15/25 [00:02<00:01,  6.93it/s]
 64%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 16/25 [00:02<00:01,  6.92it/s]
 68%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   | 17/25 [00:02<00:01,  6.92it/s]
 72%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 18/25 [00:02<00:01,  6.92it/s]
 76%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  | 19/25 [00:02<00:00,  6.91it/s]
 80%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 20/25 [00:02<00:00,  6.91it/s]
 84%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 21/25 [00:02<00:00,  6.91it/s]
 88%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 22/25 [00:03<00:00,  6.91it/s]
 92%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 23/25 [00:03<00:00,  6.91it/s]
 96%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 24/25 [00:03<00:00,  6.90it/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 25/25 [00:03<00:00,  6.90it/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 25/25 [00:03<00:00,  7.07it/s]
[~] Saving to output_images/generated_0.webp...
[~] Output format: WEBP
[~] Output quality: 80
Version Details
Version ID
60015df78a8a795470da6494822982140d57b150b9ef14354e79302ff89f69e3
Version Created
May 21, 2024
Run on Replicate β†’