If we are talking about DiffEdit in this lesson, I’m reaaaally looking forward to it! Hoping to learn some new stuff which will help with the work I’ve been doing on prompt editing
Sometimes a paper has an associated explanation video posted to YouTube (especially if the paper is from a major research lab) and so it’s worth searching the paper title there or on Google video search to check if such a video exists.
Theoretically, you should be able to mask the foreground object that you want to retain and then reverse the mask to mask only the object and let everything else be modified. That should allow you to modify the background …
You could define your foreground object and then expand the query engine so that you can use a symbol like ^ to select everything but that foreground object. So say if you want to change the background of the horse image, you could use “^horse on seaside” as a query.
Also if I find a paper I really like I will check the authors and if they consistently do good work I often will follow them on Twitter. Sometimes they will post their own tweets or even threads about their paper.
def broadcast(a, b, op):
if isinstance(a, Number) and isinstance(b, Number):
return op(a, b)
result = []
if a.ndim == b.ndim:
if a.shape[0] != b.shape[0]:
if a.shape[0] == 1:
a = cycle(a)
elif b.shape[0] == 1:
b = cycle(b)
else:
raise ValueError(
f"Could not broadcast together with shapes {a.shape} {b.shape}")
elif a.ndim < b.ndim:
a = cycle([a])
else:
b = cycle([b])
for a_in, b_in in zip(a, b):
result.append(broadcast(a_in, b_in, op))
return np.array(result)```