Skip to content

Commit 3f50f61

Browse files
committed
Deploy sherin-for-runway OSS: 004
Package version: v0.1.0. Publish the standalone sherin-for-runway OSS. See CHANGELOG.md for the complete change summary.
1 parent 6e7500d commit 3f50f61

26 files changed

Lines changed: 1563 additions & 441 deletions

app/dashboard/gallery/_components/gallery-preview-panel.tsx

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import { Hourglass, ImageMinus, ImageOff } from 'lucide-react';
55
import { ImageLoadingSkeleton } from '../../_components/image-loading-skeleton';
66

77
export function GalleryPreviewPanel({
8-
contentType,
98
previewUrl,
109
priority = false,
1110
prompt,
1211
ratio,
1312
status,
1413
}: {
15-
contentType?: string | null;
1614
previewUrl: string | null;
1715
priority?: boolean;
1816
prompt: string;
@@ -28,7 +26,6 @@ export function GalleryPreviewPanel({
2826
const imageUnavailable = Boolean(
2927
previewUrl && unavailablePreviewUrl === previewUrl,
3028
);
31-
const isVideoPreview = contentType?.startsWith('video/') ?? false;
3229
const showPreview = Boolean(previewUrl && !imageUnavailable);
3330
const showLoadingPreview = showPreview && !imageLoaded;
3431
const handlePreviewImageRef = useCallback(
@@ -56,57 +53,33 @@ export function GalleryPreviewPanel({
5653
href={previewUrl}
5754
target="_blank"
5855
rel="noreferrer noopener"
59-
aria-label={
60-
isVideoPreview ? 'Open generated video' : 'Open generated image'
61-
}
56+
aria-label="Open generated image"
6257
aria-busy={showLoadingPreview}
6358
className="group relative mt-4 block aspect-[4/3] overflow-hidden rounded-2xl border border-white/10 bg-slate-950"
6459
>
6560
{showLoadingPreview ? <ImageLoadingSkeleton /> : null}
66-
{isVideoPreview ? (
67-
<video
68-
src={previewUrl}
69-
muted
70-
playsInline
71-
preload="metadata"
72-
className={`absolute inset-0 size-full bg-black object-contain transition duration-500 ${
73-
imageLoaded ? 'opacity-100' : 'opacity-0'
74-
}`}
75-
onCanPlay={() => {
76-
setLoadedPreviewUrl(previewUrl);
77-
setUnavailablePreviewUrl((currentPreviewUrl) =>
78-
currentPreviewUrl === previewUrl ? null : currentPreviewUrl,
79-
);
80-
}}
81-
onError={() => {
82-
setLoadedPreviewUrl(null);
83-
setUnavailablePreviewUrl(previewUrl);
84-
}}
85-
/>
86-
) : (
87-
<img
88-
ref={handlePreviewImageRef}
89-
src={previewUrl}
90-
alt={`Generated image for: ${prompt}`}
91-
className={`absolute inset-0 size-full object-cover transition duration-500 group-hover:scale-[1.02] ${
92-
imageLoaded ? 'opacity-100' : 'opacity-0'
93-
}`}
94-
decoding="async"
95-
fetchPriority={priority ? 'high' : 'auto'}
96-
loading={priority ? 'eager' : 'lazy'}
97-
onLoad={() => {
98-
setLoadedPreviewUrl(previewUrl);
99-
setUnavailablePreviewUrl((currentPreviewUrl) =>
100-
currentPreviewUrl === previewUrl ? null : currentPreviewUrl,
101-
);
102-
}}
103-
onError={() => {
104-
setLoadedPreviewUrl(null);
105-
setUnavailablePreviewUrl(previewUrl);
106-
}}
107-
sizes="(min-width: 1280px) 25vw, (min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw"
108-
/>
109-
)}
61+
<img
62+
ref={handlePreviewImageRef}
63+
src={previewUrl}
64+
alt={`Generated image for: ${prompt}`}
65+
className={`absolute inset-0 size-full object-cover transition duration-500 group-hover:scale-[1.02] ${
66+
imageLoaded ? 'opacity-100' : 'opacity-0'
67+
}`}
68+
decoding="async"
69+
fetchPriority={priority ? 'high' : 'auto'}
70+
loading={priority ? 'eager' : 'lazy'}
71+
onLoad={() => {
72+
setLoadedPreviewUrl(previewUrl);
73+
setUnavailablePreviewUrl((currentPreviewUrl) =>
74+
currentPreviewUrl === previewUrl ? null : currentPreviewUrl,
75+
);
76+
}}
77+
onError={() => {
78+
setLoadedPreviewUrl(null);
79+
setUnavailablePreviewUrl(previewUrl);
80+
}}
81+
sizes="(min-width: 1280px) 25vw, (min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw"
82+
/>
11083
<RatioOverlay ratio={ratio} />
11184
</a>
11285
);

app/dashboard/gallery/page.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { getStorageProviderStatus } from '@/lib/storage';
2727
import { getUser } from '@/lib/database/server-actions';
2828
import { formatDate } from '@/lib/utils';
2929
import { InlineBabySea } from '@/components/icons/inline-babysea';
30-
import { InlineByokInferenceProviderLight } from '@/components/icons/inline-inference';
30+
import { InlineRunwayLight } from '@/components/icons/inline-inference';
3131
import {
3232
InlineAwsS3Storage,
3333
InlineCloudflareR2Storage,
@@ -79,10 +79,6 @@ export default async function GalleryPage() {
7979

8080
return {
8181
...generation,
82-
assetContentType: getGenerationMetadataString(
83-
generation.metadata,
84-
'sherin_asset_content_type',
85-
),
8682
model: request.model,
8783
outputFormat: request.outputFormat,
8884
prompt: request.prompt,
@@ -153,7 +149,6 @@ export default async function GalleryPage() {
153149
</p>
154150

155151
<GalleryPreviewPanel
156-
contentType={generation.assetContentType}
157152
priority={index < 4}
158153
prompt={generation.prompt}
159154
previewUrl={generation.previewUrl}
@@ -178,7 +173,6 @@ function createSampleGalleryRow() {
178173
return {
179174
created_at: SHERIN_SAMPLE_RESULT.createdAt,
180175
id: SHERIN_SAMPLE_RESULT.id,
181-
assetContentType: 'image/jpeg',
182176
imageInfo:
183177
'Sample image only. Your first real generation will replace this card.',
184178
previewUrl: SHERIN_SAMPLE_RESULT.previewUrl,
@@ -331,7 +325,7 @@ function inferenceProviderSummaryValue(provider: string): ProviderSummaryValue {
331325
return {
332326
content: (
333327
<>
334-
<InlineByokInferenceProviderLight
328+
<InlineRunwayLight
335329
className="h-3.5 w-5 shrink-0"
336330
aria-hidden="true"
337331
/>

app/dashboard/references/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { getStorageProviderStatus, resolveStoredAssetUrl } from '@/lib/storage';
2525
import { getUser } from '@/lib/database/server-actions';
2626
import { formatDate } from '@/lib/utils';
2727
import { InlineBabySea } from '@/components/icons/inline-babysea';
28-
import { InlineByokInferenceProviderLight } from '@/components/icons/inline-inference';
28+
import { InlineRunwayLight } from '@/components/icons/inline-inference';
2929
import {
3030
InlineAwsS3Storage,
3131
InlineCloudflareR2Storage,
@@ -347,7 +347,7 @@ function inferenceProviderSummaryValue(provider: string): ProviderSummaryValue {
347347
return {
348348
content: (
349349
<>
350-
<InlineByokInferenceProviderLight
350+
<InlineRunwayLight
351351
className="h-3.5 w-5 shrink-0"
352352
aria-hidden="true"
353353
/>

0 commit comments

Comments
 (0)