@umituz/react-native-ai-generation-content 1.14.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/package.json +2 -2
  2. package/src/features/audio-generation/index.ts +0 -1
  3. package/src/features/colorization/index.ts +0 -1
  4. package/src/features/face-swap/index.ts +0 -1
  5. package/src/features/future-prediction/index.ts +0 -1
  6. package/src/features/image-captioning/index.ts +0 -1
  7. package/src/features/inpainting/index.ts +0 -1
  8. package/src/features/photo-restoration/index.ts +0 -1
  9. package/src/features/sketch-to-image/index.ts +0 -1
  10. package/src/features/style-transfer/index.ts +0 -1
  11. package/src/features/text-to-image/index.ts +0 -1
  12. package/src/features/text-to-video/index.ts +0 -1
  13. package/src/features/upscaling/index.ts +0 -1
  14. package/src/index.ts +24 -0
  15. package/src/presentation/components/index.ts +1 -0
  16. package/src/presentation/components/photo-step/PhotoStep.tsx +96 -0
  17. package/src/presentation/components/photo-step/index.ts +2 -0
  18. package/src/presentation/hooks/base/index.ts +9 -0
  19. package/src/presentation/hooks/base/types.ts +47 -0
  20. package/src/presentation/hooks/base/use-dual-image-feature.ts +178 -0
  21. package/src/presentation/hooks/base/use-image-with-prompt-feature.ts +170 -0
  22. package/src/presentation/hooks/base/use-single-image-feature.ts +154 -0
  23. package/src/presentation/hooks/index.ts +9 -0
  24. package/src/presentation/hooks/useGenerationFlow.ts +315 -0
  25. package/src/presentation/types/flow-config.types.ts +246 -0
  26. package/src/features/audio-generation/presentation/hooks.ts +0 -39
  27. package/src/features/colorization/presentation/hooks.ts +0 -39
  28. package/src/features/face-swap/presentation/hooks.ts +0 -41
  29. package/src/features/future-prediction/presentation/hooks.ts +0 -39
  30. package/src/features/image-captioning/presentation/hooks.ts +0 -39
  31. package/src/features/inpainting/presentation/hooks.ts +0 -39
  32. package/src/features/photo-restoration/presentation/hooks.ts +0 -39
  33. package/src/features/sketch-to-image/presentation/hooks.ts +0 -39
  34. package/src/features/style-transfer/presentation/hooks.ts +0 -39
  35. package/src/features/text-to-image/presentation/hooks.ts +0 -39
  36. package/src/features/text-to-video/presentation/hooks.ts +0 -39
  37. package/src/features/upscaling/presentation/hooks.ts +0 -39
@@ -1,39 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
- /* eslint-disable @typescript-eslint/ban-ts-comment */
3
- /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
4
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
- /* eslint-disable @typescript-eslint/no-unsafe-call */
6
- /* eslint-disable @typescript-eslint/no-explicit-any */
7
- import { useState, useCallback } from 'react';
8
- import { useGeneration } from '../../../presentation/hooks/use-generation';
9
- import { UpscaleRequest, UpscaleResult } from '../domain/entities';
10
-
11
- export interface UseUpscalingReturn {
12
- upscale: (request: UpscaleRequest) => Promise<UpscaleResult>;
13
- isUpscaling: boolean;
14
- result: UpscaleResult | null;
15
- error: Error | null;
16
- }
17
-
18
- export const useUpscaling = (): UseUpscalingReturn => {
19
- const { generate, isGenerating, error, result: genResult } = useGeneration({ model: "deprecated" });
20
- const [result, setResult] = useState<UpscaleResult | null>(null);
21
-
22
- const upscale = useCallback(async (request: UpscaleRequest) => {
23
- await generate(request as any);
24
-
25
- if (genResult?.data) {
26
- setResult(genResult.data as UpscaleResult);
27
- return genResult.data as UpscaleResult;
28
- }
29
-
30
- throw new Error('Upscaling failed to return a result');
31
- }, [generate, genResult]);
32
-
33
- return {
34
- upscale,
35
- isUpscaling: isGenerating,
36
- result,
37
- error: error as any,
38
- };
39
- };