MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / adaption_r

Method adaption_r

diffusers/examples/community/sde_drag.py:379–384  ·  view source on GitHub ↗
(source, target, adapt_radius, max_height, max_width)

Source from the content-addressed store, hash-verified

377 self, latent, source_new, target_new, adapt_radius, max_height, max_width, image_scale, noise_scale, generator
378 ):
379 def adaption_r(source, target, adapt_radius, max_height, max_width):
380 r_x_lower = min(adapt_radius, source[0], target[0])
381 r_x_upper = min(adapt_radius, max_width - source[0], max_width - target[0])
382 r_y_lower = min(adapt_radius, source[1], target[1])
383 r_y_upper = min(adapt_radius, max_height - source[1], max_height - target[1])
384 return r_x_lower, r_x_upper, r_y_lower, r_y_upper
385
386 for source_, target_ in zip(source_new, target_new):
387 r_x_lower, r_x_upper, r_y_lower, r_y_upper = adaption_r(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected