MCPcopy Create free account
hub / github.com/OpenGVLab/DragGAN / on_new_image

Function on_new_image

gradio_app.py:142–161  ·  view source on GitHub ↗
(model, seed)

Source from the content-addressed store, hash-verified

140
141
142def on_new_image(model, seed):
143 G = model['G']
144 W = draggan.generate_W(
145 G,
146 seed=int(seed),
147 device=device,
148 truncation_psi=0.8,
149 truncation_cutoff=8,
150 )
151 img, _ = draggan.generate_image(W, G, device=device)
152
153 state = {
154 'W': W,
155 'img': img,
156 'history': []
157 }
158
159 points = {'target': [], 'handle': []}
160 target_point = False
161 return img, img, state, points, target_point
162
163
164def on_max_iter_change(max_iters):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected